Re: Why is the php loop, 'for()', so slow????

From: Date: Thu, 20 Nov 2003 20:05:14 +0000
Subject: Re: Why is the php loop, 'for()', so slow????
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-170490@lists.php.net to get a copy of this message
On Thu, Nov 20, 2003 at 09:45:45AM -0500, Scott Fletcher wrote: : : I can give the strpos() a shot but I seem to have problem with getting the : strpos() to give me two seperate "<!CDATA[[****]]>" tags instead of just hte : first one only... Use the offset parameter: <?php $haystack = 'To be or not to be.'; $needle = 'be'; $needlesize = strlen($needle); $pos = 0; while (($pos = strpos($haystack, $needle, $pos)) !== false) { echo '$pos = '.$pos."\n"; $pos += $needlesize; } ?>

« previous php.general (#170490) next »