RE: [PHP] Explanation
| From: | Martin Towell | Date: | Thu, 29 Nov 2001 01:28:55 +0000 |
| Subject: | RE: [PHP] Explanation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75971@lists.php.net to get a copy of this message | ||
it's a ternary operator
$string1 = (isset($string2)) ? $HTTP_GET_VARS['pid'] : "";
is the same as
if (isset($string2))
$string1 = $HTTP_GET_VARS['pid'];
else
$string1 = "";
-----Original Message-----
From: Gerard Samuel [mailto:trini0@optonline.net]
Sent: Thursday, November 29, 2001 12:28 PM
To: PHP
Subject: [PHP] Explanation
Hi. Im looking over someone else's code and I come across something I
dont understand and dont know where in the manual to look for it.
Here is an example ==>
$string1 = (isset($string2)) ? $HTTP_GET_VARS['pid'] : "";
I have no idea what the '?' in the line and the ':' at the end, so I
have no way of interpreting what $string1 could be.
If you could point me to the page in the manual that would be great.
Thanks...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net