note 68955 modified in function.isset by thiago
| From: | thiago@php.net | Date: | Tue, 05 Aug 2008 18:43:30 +0000 |
| Subject: | note 68955 modified in function.isset by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143178@lists.php.net to get a copy of this message | ||
fyi:
you *cannot* do assignments inside of the isset() function. although you *can* while inside of other
functions such as is_null().
<?php
if (isset($var = $_GET['key'])) echo 'whatever'; //this will throw an error :(
if (is_null($var = $_GET['key'])) echo 'whatever'; //this will not :)
?>
hope someone finds this useful.
--was--
fyi:
you *cannot* do assignments inside of the isset() function. although you *can* while inside of other
functions such as is_null().
if (isset($var = $_GET['key'])) echo 'whatever'; //this will throw an error :(
if (is_null($var = $_GET['key'])) echo 'whatever'; //this will not :)
hope someone finds this useful.
http://php.net/manual/en/function.isset.php