note 51202 added to function.strpos

From: Date: Wed, 23 Mar 2005 12:49:09 +0000
Subject: note 51202 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-86840@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51202 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51202&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51202&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51202&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51202&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51202&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51202&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86840) next »