note 21468 added to function.explode

From: Date: Tue, 14 May 2002 12:47:33 +0000
Subject: note 21468 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-30623@lists.php.net to get a copy of this message
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!"; } -- http://www.php.net/manual/en/function.explode.php http://master.php.net/manage/user-notes.php?action=edit+21468 http://master.php.net/manage/user-notes.php?action=delete+21468 http://master.php.net/manage/user-notes.php?action=reject+21468

« previous php.notes (#30623) next »