Menu

#4 PHP Warning: array_key_exists()

open
nobody
None
5
2007-01-06
2007-01-06
Anonymous
No

PHP Warning: array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /var/www/weather/pxweather.class.php on line 98

/*
** Return a specific field from the current weather report
*/
function getCurrent($field) {
$o = $this->_getObservation();

if (array_key_exists($field, $o)) {
return $o[$field];
}
else {
return null;
}
}

Line 98 is: if (array_key_exists($field, $o)) {

Any clues about this?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB