Problem with array_key_exists
Posted: Sun Mar 05, 2006 4:30 am
I have been passing values to a function which checks whether or not a key exists in an array. Everything worked fine until I starting using keys with letters. Here is an example of the array:
The code that checks is:
Code: Select all
Array
(
[0] =>
[a] => blah
[b] => blah
[c] => blah
)Code: Select all
function check_key($Key, $Array) {
if (array_key_exists($Key, $Array)) {
return true;
} else {
return false;
}
}