note 118351 deleted from function.isset by cmb
| From: | cmb@php.net | Date: | Sun, 05 Jan 2020 08:07:32 +0000 |
| Subject: | note 118351 deleted from function.isset by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213731@lists.php.net to get a copy of this message | ||
Note Submitter: ohcc at 163 dot com
----
When a variable is set and its values is null, isset() returns false.
You can use array_key_exists() to check whether a null value variable exists.
<?php
$wxc = null;
var_dump( isset( $wxc ) );
var_dump( array_key_exists( 'wxc', $GLOBALS ) );
?>
Output of the above example:
bool(false) bool(true)