note 110267 added to function.strpos

From: Date: Sat, 06 Oct 2012 05:53:27 +0000
Subject: note 110267 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-191157@lists.php.net to get a copy of this message
There is a more efficient way when looking for the position of each occurrence: while($count = strpos($input1, $input2, $count+1)) $output[] = $count+1; Use the offset value, then you don't spend a ton of time re-writing the value into memory ---- Server IP: 64.71.164.2 Probable Submitter: 67.161.209.88 ---- Manual Page -- http://www.php.net/manual/en/function.strpos.php Edit -- https://master.php.net/note/edit/110267 Del: integrated -- https://master.php.net/note/delete/110267/integrated Del: useless -- https://master.php.net/note/delete/110267/useless Del: bad code -- https://master.php.net/note/delete/110267/bad+code Del: spam -- https://master.php.net/note/delete/110267/spam Del: non-english -- https://master.php.net/note/delete/110267/non-english Del: in docs -- https://master.php.net/note/delete/110267/in+docs Del: other reasons-- https://master.php.net/note/delete/110267 Reject -- https://master.php.net/note/reject/110267 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191157) next »