question about ? :
| From: | Lee Doolan | Date: | Fri, 14 Jun 2002 00:09:13 +0000 |
| Subject: | question about ? : | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102109@lists.php.net to get a copy of this message | ||
the arrays below have dates like
dateA= array( 0=> "03", 1=> "22", 2=> "02")
for 22march2002.
why does this work:
$retval= ($dateA[2] != $dateB[2])
? strcmp($dateA[2], $dateB[2])
: (($dateA[0] != $dateB[0])
? strcmp($dateA[0], $dateB[0])
: (($dateA[1] != $dateB[1])
? strcmp($dateA[1], $dateB[1])
: 0));
but not this:
$retval= ($dateA[2] != $dateB[2])
? strcmp($dateA[2], $dateB[2])
: ($dateA[0] != $dateB[0])
? strcmp($dateA[0], $dateB[0])
: ($dateA[1] != $dateB[1])
? strcmp($dateA[1], $dateB[1])
: 0;
--
When the birdcage is open, | donate to causes I care about:
the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25
but the virtuous one stays. |