RE: [PHP] Someone please help me with this PHP script.
| From: | Oli Howson | Date: | Sun, 18 Dec 2005 15:56:39 +0000 |
| Subject: | RE: [PHP] Someone please help me with this PHP script. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-227606@lists.php.net to get a copy of this message | ||
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?