Possible Duplicate:
PHP Arrays: A good way to check if an array is associative or sequential?
Hello :)
I was wondering what is the shortest (best) way to check if an array is
a list:
array('a', 'b', 'c')
or it's an associative array:
array('a' => 'b', 'c' => 'd')
fyi: I need this to make a custom json_encode function
json_encodefunction though? Are you on a PHP version that doesn't have it yet? There are pre-made packages for that case.json_encodeare available for download, so maybe check them out and customize them? Here's one: boutell.com/scripts/jsonwrapper.htmljson_encoderesult?