FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » evaluating a null value in an array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: evaluating a null value in an array [message #173833 is a reply to message #173832] Sat, 07 May 2011 16:34 Go to previous message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma:
Member
Am 2011-05-07 17:30, Denis McMahon meinte:
> On Sat, 07 May 2011 07:27:21 -0400, bill wrote:
>
>> a suggestion on how to evaluate this value.
>
> if (
> !(isset($insInfo[3])) // $insInfo3 not defined
> || (is__null($insInfo[3])) // $insInfo3 defined and null

Not necessary.

isset() also returns false when the tested variable is set to NULL [1].

$bar = NULL;
var_dump(isset($foo)); // FALSE
var_dump(isset($bar)); // FALSE

Gregor


[1]
http://php.net/manual/de/function.isset.php

--
http://vxweb.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Design minisite with minisite master tutorial
Next Topic: getting only the temperature & general weather condition
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Oct 07 11:23:11 GMT 2024

Total time taken to generate the page: 0.04255 seconds