PHP Recursive Array Replace by Key or Value