I am trying to remove all spaces in array keys names i.e. str_replace(\' \',\'\',$value) (or worst cast scenario replace them with underscores (_) )
and I am trying
function array_stripstuff(&$elem) { if (is_array($elem)) { foreach ($elem as $key=>$value) $elem[str_replace(" ","-",$key)]=$value; } return $elem; } $strippedarray = array_walk_recursive($yourarray,'array_stripstuff');
There you go :-)