Re: Pass Variable Names to a Function

From: Date: Fri, 01 Feb 2008 17:05:23 +0000
Subject: Re: Pass Variable Names to a Function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-268535@lists.php.net to get a copy of this message
Bill Guion wrote:
I would like to use a function to check to see if a session variable is set and return the session variable if it is set, and return blank if not. Something like
You really don't need a function for this: // Could use null instead of false $variable = isset($_SESSION[$name]) ? $_SESSION[$name] : false; -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software for £299pa hosted for you - no installation, no maintenance, new features automatic and free

« previous php.general (#268535) next »