note 77005 added to function.str-replace

From: Date: Thu, 09 Aug 2007 19:50:14 +0000
Subject: note 77005 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-129385@lists.php.net to get a copy of this message
This is the functions I wrote for the problem reported above, str_replace in multi-dimensional arrays. It can work with preg_replace as well. function array_replace($SEARCH,$REPLACE,$INPUT) { if (is_array($INPUT) and count($INPUT)<>count($INPUT,1)): foreach($INPUT as $FAN): $OUTPUT[]=array_replace($SEARCH,$REPLACE,$FAN); endforeach; else: $OUTPUT=str_replace($SEARCH,$REPLACE,$INPUT); endif; return $OUTPUT; } ---- Server IP: 130.206.1.5 Probable Submitter: 84.77.247.241 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/77005 Del: integrated -- https://master.php.net/note/delete/77005/integrated Del: useless -- https://master.php.net/note/delete/77005/useless Del: bad code -- https://master.php.net/note/delete/77005/bad+code Del: spam -- https://master.php.net/note/delete/77005/spam Del: non-english -- https://master.php.net/note/delete/77005/non-english Del: in docs -- https://master.php.net/note/delete/77005/in+docs Del: other reasons-- https://master.php.net/note/delete/77005 Reject -- https://master.php.net/note/reject/77005 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129385) next »