note 95696 added to function.preg-replace
| From: | alex14xp at gmail dot com | Date: | Sat, 16 Jan 2010 18:32:43 +0000 |
| Subject: | note 95696 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165029@lists.php.net to get a copy of this message | ||
I have a simpler version of the word_replace() function:
<?php
/*
Author: Alejandro of sortea2.com
(string) $search: word to search
(string) $replace: word to replace
(string) $subject: string with the word to replace
*/
function word_replace($search, $replace, $subject) {
return preg_replace('/\b('.$search.')\b/', $replace, $subject);
}
?>
----
Server IP: 80.64.47.13
Probable Submitter: 77.208.35.55
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/95696
Del: integrated -- https://master.php.net/note/delete/95696/integrated
Del: useless -- https://master.php.net/note/delete/95696/useless
Del: bad code -- https://master.php.net/note/delete/95696/bad+code
Del: spam -- https://master.php.net/note/delete/95696/spam
Del: non-english -- https://master.php.net/note/delete/95696/non-english
Del: in docs -- https://master.php.net/note/delete/95696/in+docs
Del: other reasons-- https://master.php.net/note/delete/95696
Reject -- https://master.php.net/note/reject/95696
Search -- https://master.php.net/manage/user-notes.php