protected function filterArrayStrings($array, $search, $replace)
    {
        $return = array();
        foreach ((array)$array as $key => $value) {
            $key = str_replace($search, $replace, $key);
            $value = is_array($value)
                ? $this->filterArrayStrings($value, $search, $replace)
                : str_replace($search, $replace, $value);

            $return[$key] = $value;
        }

        return $return;
    }
protected function filterArrayStrings($array, $search, $replace)
    {
        $return = array();
        foreach ((array)$array as $key => $value) {
            $key = str_replace($search, $replace, $key);
            $value = is_array($value)
                ? $this->filterArrayStrings($value, $search, $replace)
                : str_replace($search, $replace, $value);

            $return[$key] = $value;
        }

        return $return;
    }
protected function filterArrayStrings ( $ array , $ search , $ replace ) { $ return = array ( ) ; foreach ( ( array ) $ array as $ key => $ value ) { $ key = str_replace ( $ search , $ replace , $ key ) ; $ value = is_array ( $ value ) ? $ this -> filterArrayStrings ( $ value , $ search , $ replace ) : str_replace ( $ search , $ replace , $ value ) ; $ return [ $ key ] = $ value ; } return $ return ; }
Replaces strings in array keys and values recursively.

@param array        $array   Target array
@param string|array $search  Search string(s)
@param string|array $replace Replacement string(s)

@return array
Replaces strings in array keys and values recursively .