Re: Re:imap_search and results

From: Date: Thu, 26 Aug 2004 15:35:02 +0000
Subject: Re: Re:imap_search and results
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194807@lists.php.net to get a copy of this message
On Thu, 2004-08-26 at 09:25, fongming wrote: > for($i=0;$i<count($mails);$i++) > { > $h=@imap_header($mbox,$mails[$x-1]); > echo $subject=$h->subject; > echo $sender=$h->from[0]; > echo "<BR>"; > } Calling count() every time the for loop iterates is inefficient. $count = count($mails); for($i=0; $i<$count; $i++){ } -- Greg Donald

« previous php.general (#194807) next »