Re: do this OR that

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Judson,

Thursday, December 1, 2005, 12:40:16 PM, you wrote:

> I believe I should re-write it like this:

> <snippet>                               
>    $total = ($mygrade/$quiz->grade) ;
>    if ($total > .80 | .80)  {
> </snippet>

> Is that right? Thanks in advance for your help.

'OR' is ||, but you need to add the equation as well, i.e.:

if ($total > 0.80 || $total == 0.80)

However, you can write the above much more easily with:

if ($total >= 0.80)

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux