note 74753 added to function.preg-replace
| From: | igasparettoathotmaildotcom at osu1 dot php dot net | Date: | Thu, 26 Apr 2007 08:21:06 +0000 |
| Subject: | note 74753 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125879@lists.php.net to get a copy of this message | ||
Displaying results of a search engine:
$words=explode(" ", $_POST['query']);
foreach($words as $word){
$patterns[]='/'.$word.'/i';
$replaces[]='<span class="textFound">$0</span>';
}
// run sql
$display_results="";
foreach($res as $row)
$display_results .= "<p>" . preg_replace($patterns, $replaces, nl2br(htmlentities(
$row['field'] ) ) ) . "</p>\n";
echo $display_results;
----
Server IP: 194.145.210.3
Probable Submitter: 88.96.159.1
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/74753
Del: integrated -- https://master.php.net/note/delete/74753/integrated
Del: useless -- https://master.php.net/note/delete/74753/useless
Del: bad code -- https://master.php.net/note/delete/74753/bad+code
Del: spam -- https://master.php.net/note/delete/74753/spam
Del: non-english -- https://master.php.net/note/delete/74753/non-english
Del: in docs -- https://master.php.net/note/delete/74753/in+docs
Del: other reasons-- https://master.php.net/note/delete/74753
Reject -- https://master.php.net/note/reject/74753
Search -- https://master.php.net/manage/user-notes.php