Re: [SMARTY] if with incremental numbers

From: Date: Wed, 09 Jul 2003 10:45:27 +0000
Subject: Re: [SMARTY] if with incremental numbers
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9854@lists.php.net to get a copy of this message
Olivier Doucet writes: > The $i==4 || etc. is not very efficient. > In php i would use if (rand($i/4)==($i/4)) Assuming you meant "round" not "rand", you could also say in PHP: if ($i % 4 == 0) In Smarty: {if $i is div by 4} I think {if not $i mod 4} would also work. Mark Rogers, More Solutions Ltd

« previous php.smarty.general (#9854) next »