note 57891 deleted from function.strstr by jome
| From: | jome@php.net | Date: | Tue, 18 Oct 2005 12:54:29 +0000 |
| Subject: | note 57891 deleted from function.strstr by jome | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97167@lists.php.net to get a copy of this message | ||
Note Submitter: info at simply-networks dot de
Reason: useless
----
//Load a Array and select one Sting if the function STRSTR doesnt find the such word.
Enviroment Details: SuSE Linux 9.0; PHP 4
$a = array('first String','second String','Third String','more
Strings','fiveth String');
//we such all String if Word "more" isnt there
foreach ($a as $key => $data){
if(!strstr($data,"more")){ //looking for more
$select = array_shift($a);//get one from array
}
}
print_r($a);
//if you print this you have 'fiveth String' into the array
Note: if you use if(strstr($data,"more")){ ... you will get second, Third Strings!!