27; : '#E3E8F0');
}
$time_end4 = getmicrotime();
$time4 = $time_end4 - $time_start4;
echo "version four: \t$time4 seconds\n";
?>
> -Original Message-
> From: Philip Olson [mailto:[EMAIL PROTECTED]
> Sent: Saturday, April 05, 2003 7:42 PM
> To: Daev
If you really want to be optimal, use bitwise instead
of modulus :) And ++$i instead of $i++ :) And,
use single not double quotes :) Silly, but true.
http://www.faqts.com/knowledge_base/view.phtml/aid/783/fid/9
And, write less code, so:
$bgcolor = (++$i & 1) ? '#ff' : '#ee';
I had to know... ;-)
Output:
version one:0.56761503219604 seconds
version two:0.3099730014801 seconds
version three: 0.36320495605469 secondss
So the boolean (V2)is faster:
Mine is slightly slower by a 'smidge' (0.06 seconds)
Top one is cleanest but slower.
--- test ---
\n";
$time_
On 05-Apr-2003 Bobby Rahman wrote:
>
>
> Hiya people
>
> After a lot of soul searching, exploring the web and help from many
> people I
> came up with this simple solution:
>
Okey-doke. simple is in the eye of the beholder.
$bgcolor = ($bgcolor == '#E3E8F0' ? '#C7D0E2' : '#E3E8F0');
At 00:42 6-4-2003, you wrote:
Wow you guys are going about that way more complicated than it needs to
be:
$i = 0;
echo "";
Then it just alternates and takes care of itself (plus you get a nice
little index counter as well as a bonus if you want to use $i
DÆVID.
Or in my belief even faster, (withou
t;
> ");
> if ( !isset($c) )
> {
> $c = "bgcolor=#9999FF";
> echo $c;
> }
> else
> {
> unset($c);
> }
> }
>
>
>
>
> >From: Chris Hayes <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subjec
( $row = mysql_fetch_array($db_result) )
{
echo("
" . $row['bugid'] . "
");
if ( !isset($c) )
{
$c = "bgcolor=#FF";
echo $c;
}
else
{
unset($c);
}
}
From: Chris Hayes <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE:
sorry i see i made a bit too many ambiguous typing errors.
Hiya I have a dynamic table and am trying to get the rows to be two
different alternate colours. well Ive looked at a couple of snippets of
this colour code and previous mails regarding this. Im having major
troubles intergrating any of
At 22:14 5-4-2003, you wrote:
Hiya I have a dynamic table and am trying to get the rows to be two
different alternate colours. well Ive looked at a couple of snippets of
this colour code and previous mails regarding this. Im having major
troubles intergrating any of these suggestions with my c
Hiya I have a dynamic table and am trying to get the rows to be two
different alternate colours. well Ive looked at a couple of snippets of this
colour code and previous mails regarding this. Im having major troubles
intergrating any of these suggestions with my code. Can anyone suggest where
10 matches
Mail list logo