Im looking for a bit tricky thing 🙂
I have a multidimensional array like:
$array = array(
"collection" => "departments",
"action" => "find",
"args" => array ("_id" => array("$in" => "{{variablename}}"))
);
I want to have the reference of value {{variablename}} in order to change it later.
It must be a recursive function because i can’t predict where {{variablename}} is on the array.
Without recursivity no probs, but with I didn’t find how I can do that.
PS: Other solutions to transform array to string or json and use replace does not interest me. I really need reference.
Not very pretty (also not recursive, which is a good thing), but should work:
Example: http://ideone.com/hEzZk