Re: help with script needed

From: Date: Wed, 07 Mar 2007 18:26:54 +0000
Subject: Re: help with script needed
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-250025@lists.php.net to get a copy of this message
Tijnema ! escribió:
On 3/7/07, Bruce Gilbert <webguync@gmail.com> wrote:
I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing this?
I've seen that question a lot, what i use is fairly simple if( intval($number / $multiple) == ($number / $multiple ) ) try that
Very bad solution. Try the % operator: if($number % $multiple == 0) http://www.php.net/manual/en/language.operators.arithmetic.php -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; --------------------------------------------------------- Martín Marqués | Programador, DBA Centro de Telemática | Administrador Universidad Nacional del Litoral ---------------------------------------------------------

« previous php.general (#250025) next »