note 72719 added to function.str-ireplace
| From: | hans111 at yahoo dot com | Date: | Wed, 31 Jan 2007 00:26:25 +0000 |
| Subject: | note 72719 added to function.str-ireplace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122382@lists.php.net to get a copy of this message | ||
Yet another one str_ireplace ireplacement, this one will take arrays as $search and $replace
<?php
function make_pattern(&$pat, $key) {
$pat = '/'.preg_quote($pat, '/').'/i';
}
if(!function_exists('str_ireplace')){
function str_ireplace($search, $replace, $subject){
if(is_array($search)){
array_walk($search, 'make_pattern');
}
else{
$search = '/'.preg_quote($search, '/').'/i';
}
return preg_replace($search, $replace, $subject);
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 201.228.100.73
----
Manual Page -- http://www.php.net/manual/en/function.str-ireplace.php
Edit -- https://master.php.net/note/edit/72719
Del: integrated -- https://master.php.net/note/delete/72719/integrated
Del: useless -- https://master.php.net/note/delete/72719/useless
Del: bad code -- https://master.php.net/note/delete/72719/bad+code
Del: spam -- https://master.php.net/note/delete/72719/spam
Del: non-english -- https://master.php.net/note/delete/72719/non-english
Del: in docs -- https://master.php.net/note/delete/72719/in+docs
Del: other reasons-- https://master.php.net/note/delete/72719
Reject -- https://master.php.net/note/reject/72719
Search -- https://master.php.net/manage/user-notes.php