Posted by "Oli Howson" on 12/18/05 17:56
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:budduh@gmail.com]
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?
Navigation:
[Reply to this message]
|