Re: Parameter passing question [message #173545 is a reply to message #173541] |
Mon, 18 April 2011 18:28 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
Unrest wrote:
> Am Mon, 18 Apr 2011 17:42:31 +0000 schrieb Denis McMahon:
>> <?php
>> if (isset($_GET['x'])) {
>> if ($_GET['x'] == null) {
>> // it's null
>> } else {
>> // it has data
>> }
>> } else {
>> // it's not defined
>> }
>> ?>
>>
>
> isset() checks if a variable exists and _is not null_.
> -> http://de.php.net/manual/en/function.isset.php
>
> so your "if ($_GET['x'] == null)" will never evaluate to true.
True.
if (array_key_exists('x', $_GET))
{
if ($_GET['x'] == null)
{
// ...
}
}
would make sense then.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7(at)news(dot)demon(dot)co(dot)uk>
|
|
|