- ctype_digit: documentation ( source)
- implode: documentation ( source)
- array_keys: documentation ( source)
- ksort: documentation ( source)
<?php
$assoc = array(
"a" => 1,
"b" => 0,
0 => 0
);
function is_assoc($in_array){
$test_array = ksort($in_array);
return !ctype_digit( implode('', array_keys($test_array)) );
}
echo is_assoc($assoc);
?>