note 21468 deleted from function.explode by kennyt
| From: | kennyt@php.net | Date: | Sat, 28 Feb 2004 20:35:23 +0000 |
| Subject: | note 21468 deleted from function.explode by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65957@lists.php.net to get a copy of this message | ||
Note Submitter: "Gonzalo Aguirre" <sondrobe@iespana.es>
----
all those who want to make a searcher must to take care with more than one space on text.
if you want to search some words, called $words, for example, on a text called $str, you must
eliminate all its spaces like that:
$words=explode(" ",$words);
for($i=0;$i<count($words);$i++){
if (strstr($str,$words[$i]) && $words[$i]!="")
print $words[$i]." is into the string!";
}