Re: Statement Confusion
| From: | Hugh Bothwell | Date: | Thu, 06 Sep 2001 11:35:13 +0000 |
| Subject: | Re: Statement Confusion | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66201@lists.php.net to get a copy of this message | ||
"Pavel Jartsev" <papi@digitalfruit.ee> wrote in message
news:3B975A25.B7800CC@digitalfruit.ee...
> 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?