note 118351 added to function.isset

From: Date: Sat, 21 Nov 2015 08:59:41 +0000
Subject: note 118351 added to function.isset
Groups: php.notes 
Request: Send a blank email to php-notes+get-204197@lists.php.net to get a copy of this message
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) ---- Server IP: 72.52.91.14 Probable Submitter: 118.117.77.70 ---- Manual Page -- http://php.net/manual/en/function.isset.php Edit -- https://master.php.net/note/edit/118351 Del: integrated -- https://master.php.net/note/delete/118351/integrated Del: useless -- https://master.php.net/note/delete/118351/useless Del: bad code -- https://master.php.net/note/delete/118351/bad+code Del: spam -- https://master.php.net/note/delete/118351/spam Del: non-english -- https://master.php.net/note/delete/118351/non-english Del: in docs -- https://master.php.net/note/delete/118351/in+docs Del: other reasons-- https://master.php.net/note/delete/118351 Reject -- https://master.php.net/note/reject/118351 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204197) next »