Menu

#5 checking array for daycast

open
nobody
None
5
2007-07-27
2007-07-27
Anonymous
No

More of a php question, probably...

Winston-Salem (or KINT) rarely if ever has daycast info. So, when using the sample code to get daycasts, an error is generated:

Warning: Invalid argument supplied for foreach() in /pxweather/test.php

Seems like there would be a way to check if the array includes the daycast before launching into the foreach function. Unfortunately I'm a php newbie -- although I've tried to program a check, nothing seems to work. I've tried array_key_exists and isset, but can't seem to get them to do what's needed.

Any advice?

Other than this programming problem on my end, I've found pxweather very useful.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB