This is quite a unique little function. It came in handy when I had to check a "global" array holding all key elements already loaded.
CODE:
-
$foo = array('test1'=>"This is test 1",
-
-
'test2'=>"This is test 2");
-
-
$global_bar = array('test1'=>'yep its loaded');
-
-
foreach($foo as $fkey=>$f){
-
-
if(!array_key_exists($fkey, $global_bar)){
-
-
// not there - keep going.
-
-
}else{
-
-
// Yep its there.
-
-
}
-
-
}
Very simple example above - for more information check php.net: http://www.php.net/manual/en/function.array-key-exists.php