How does one loop through an array and then subsequently check to see if the current selected element is a key? Thanks.
E.g. for the following:
for($i=0;$i<count($arr);$i++) {
//if($arr[$i]) == key, or typeOf($arr[$i]) == key, then doSomething();
}
If you want to check if a key exists in an array, then use
array_key_exists()to do the other way around and get key if value exists, use
array_search():