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 #173834 is a reply to message #173827] Sat, 07 May 2011 16:35 Go to previous messageGo to previous message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma:
Member
Am 2011-05-07 13:36, Jerry Stuckle meinte:
> On 5/7/2011 7:27 AM, bill wrote:
>> I have an array of values, one of which might be null.
>>
>> This statement fails
>> if ( ($dos <= $insInfo[3]) or($dos == '0000-00-00'))
>>
>> with the error:
>> Notice: Undefined offset: 3 in /var/www/MP2010-v2/classes/cDollar.php on
>> line 237
>>
>> when $insInfo[3] is NULL.
>>
>> I figured I could shortcut the evaluation with:
>>
>> if ( ( is_null($insInfo[3])) or($dos <= $insInfo[3]) or($dos ==
>> '0000-00-00'))
>>
>> but I get the same error.
>>
>> I sure would appreciate:
>> knowing why I get the error, and
>> a suggestion on how to evaluate this value.
>>
>> bill
>
> Is it null, or is it not set? There is a difference!

Which isset() won't spot.

http://php.net/manual/de/function.isset.php


Gregor


--
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: Sun Nov 10 16:48:53 GMT 2024

Total time taken to generate the page: 0.03968 seconds