I am looking for a simple way to see if this array:
array('apples', 'bananas');
is associative or not, that is key=>value
. Now PHP will give you something like:
array(2){
[0]=>'apples'
[1] => 'bananas'
}
if you var_dump
the above array. So in theory I have my associative array. But what I am looking for is to see if array('key' => 'some value', 'some_other_key' => 'some other value');
is a "true" associative array or if its just a regular array.
I have seen a couple posts on this through out stack but a lot of their answers are really complicated or poorly written or not even OO at all.