Php – Recursively filter a multidimensional array using a 2d array of whitelisted key paths including wildcards
I have a multidimensional array with an indeterminant depth. I want to keep only some keys depending a collection of paths, but I need a generic, recursive function and not a hardcoded filter. Example: $originalArray = array( 'key1' => array(…