note 51202 deleted from function.strpos by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:41:52 +0000 |
| Subject: | note 51202 deleted from function.strpos by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154879@lists.php.net to get a copy of this message | ||
Note Submitter: edykory at bluebottle dot com
----
a shorter version of "admin at bwongar dot com" searching function:
function strpos_array($haystack, $needle){
while (($pos = strpos($haystack, $needle, $pos)) !== FALSE)
$array[] = $pos++;
return $array;
}
I like "arias" version, but I guess strlen(aguja) can be cached in a local variable.