[PHP] Statement Confusion

2001-09-06 Thread Jordan Elver

Hi,
Could any one explain what this statemnt means?

$i = (!$i)?0:$i;

Thanks,

Jord

-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Statement Confusion

2001-09-06 Thread Pavel Jartsev

Jordan Elver wrote:
 
 Hi,
 Could any one explain what this statemnt means?
 
 $i = (!$i)?0:$i;
 

http://www.php.net/manual/en/language.operators.comparison.php
RTFM :)

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Statement Confusion

2001-09-06 Thread Hugh Bothwell


Pavel Jartsev [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jordan Elver wrote:
 
  Hi,
  Could any one explain what this statemnt means?
 
  $i = (!$i)?0:$i;

Well, literally, if not-$i is equivalent to true then $i becomes string
0, otherwise $i 'becomes' $i.

A more obvious approach would be
if ($i == 0)
$i = 0;

I assume you got this out of some sort of integer-to-string conversion code?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Statement Confusion

2001-09-06 Thread Rouvas Stathis

Jordan Elver wrote:
 
 Hi,
 Could any one explain what this statemnt means?
 
 $i = (!$i)?"0":$i;

if (!$i) then
  $i = "0";
else
  $i = $i;

-Stathis

 
 Thanks,
 
 Jord
 
 --
 Jordan Elver
 Web Developer
 The InternetOne UK Ltd
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]