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
evaluating a null value in an array [message #173825] Sat, 07 May 2011 11:27 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
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
[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: Wed Nov 27 02:12:14 GMT 2024

Total time taken to generate the page: 0.05444 seconds