note 95557 modified in function.isset by danbrown

From: Date: Fri, 08 Jan 2010 22:20:19 +0000
Subject: note 95557 modified in function.isset by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164799@lists.php.net to get a copy of this message
Here's a nice little function that I use everywhere that'll help with setting alternate values so you don't have a bunch of situations like: <?php if(isset($a)) { $b = $a; } else { $b = "default"; } function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } ?> --was-- Here's a nice little function that I use everywhere that'll help with setting alternate values so you don't have a bunch of situations like: if(isset($a)) { $b = $a; } else { $b = "default"; } function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } http://php.net/manual/en/function.isset.php

« previous php.notes (#164799) next »