note 95866 deleted from language.operators.comparison by thiago
| From: | thiago@php.net | Date: | Tue, 26 Jan 2010 19:12:53 +0000 |
| Subject: | note 95866 deleted from language.operators.comparison by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165330@lists.php.net to get a copy of this message | ||
Note Submitter: jeff at ridgeequipment dot com
----
To Anonymous:
It looks like you want $_POST['Unexisting'] to be false if it is not passed in. To
accomplish this, just use isset()
<?php
// if-then can be on one line if you want
if(!isset($_POST['Unexisting']))
$_POST['Unexisting'] = false;
//or using the ?:
$_POST['Unexisting'] = isset($_POST['Unexisting']) :
$_POST['Unexisting'] ? false;
?>
I think the first way is easier to read.