note 53746 added to function.str-ireplace
| From: | AndrewCassidyandee at bytz dot co dot uk | Date: | Sat, 11 Jun 2005 12:30:55 +0000 |
| Subject: | note 53746 added to function.str-ireplace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90263@lists.php.net to get a copy of this message | ||
My earlier posted example could actually probably be modified to include the count parameter.
I'll look into that later, but here's what I think it should look like.
<?php
function str_Ireplace($search, $replace, $subject, $count=null) {
if (is_array($search)) {
foreach ($search as $word) {
$words[] = "/".$word."/i";
}
}
else {
$words = "/".$search."/i";
}
return preg_replace($words, $replace, $subject, $count);
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.str-ireplace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53746
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53746&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53746&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53746&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53746&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53746&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53746&report=yes
Search -- http://master.php.net/manage/user-notes.php