note 87380 deleted from function.isset by danbrown

From: Date: Tue, 02 Dec 2008 18:45:59 +0000
Subject: note 87380 deleted from function.isset by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147565@lists.php.net to get a copy of this message
Note Submitter: jc AT chenailler.com ---- I agree with jwvdveer at gmail dot com, but it is also possible to user a pointer to avoid these warnings : function is(&$v, $d=null) { return isset($v) ? $v : $d; } By the way i've added a default value so you can set a custom default value: $val = is($_POST['val'], 10); will return 10 if $_POST['val'] is not setted ! :)

« previous php.notes (#147565) next »