note 35976 deleted from function.strrpos by kennyt
| From: | kennyt@php.net | Date: | Sat, 06 Mar 2004 18:24:09 +0000 |
| Subject: | note 35976 deleted from function.strrpos by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66349@lists.php.net to get a copy of this message | ||
Note Submitter: junk dot mail at relatebase.com
----
If the string starts at the beginning, the return is zero. If it's not there, it returns
"" (nothing, i.e. empty).
Simple way to figure between all three:
$result=strrpos($string, $needle);
if(strlen($result)){ //even is string is 0, length is still 1
//it's there, zero really means zero (or first pos'tn in this case)
}else{
//it's not there (returned empty);
}