On Feb 4, 2008 8:24 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> function silly($var){
> return isset($_SESSION[$var]) ? $_SESSION[$var] : '';
> }
>
> silly('foo');
There's also
--
Daniel P. Brown
Senior Unix Geek
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
function silly($var){
return isset($_SESSION[$var]) ? $_SESSION[$var] : '';
}
silly('foo');
On Fri, February 1, 2008 10:49 am, 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 no
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])
On Feb 1, 2008 10:49 AM, Bill Guion <[EMAIL PROTECTED]> 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
>
> function set_var($var)
>{
>echo "var = $var \n";
echo "
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
function set_var($var)
{
echo "var = $var \n";
if (isset($_SESSION['$var']))
{
return $_SESSION['$var'];
}
else
5 matches
Mail list logo