You are here: Re: How can I change every second row? « PHP Programming Language « IT news, forums, messages
Re: How can I change every second row?

Posted by Martijn on 06/26/05 02:24

>>> I had to add $x=$x+1;
>>>
>>> but perhaps there is another way?
>>
>>
>> $x++;

Some other approaches:

$x = 0;
if ( ++$x % 2 )
{
...
}

would be even shorter, or:

$x = 0;
if ( $x = ~$x )
{
...
}

would also work.

--
Martijn
http://www.sereneconcepts.nl

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация