The ? And : are a shortcut for ifelse, that could also be written

If (isset($_GET['page'])
{
 $page = $_GET['page'];
}
else
{
 $page = null;
}

The shortcut is a lot quicker to write (if you understand it) but not as
readable.

isset just returns true if a variable has been set, false if not :)

hth

-----Original Message-----
From: Erik Johnson [mailto:[EMAIL PROTECTED] 
Sent: 18 December 2005 15:42
To: php-general@lists.php.net
Subject: Re: [PHP] Someone please help me with this PHP script.

I was wondering.. how exactly does the isset function work?  I saw that
Robert Cummings wrote:

$page = isset( $_GET['page'] ) ? $_GET['page'] : null;

What exactly does that mean?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to