Voting

: two plus two?
(Example: nine)

The Note You're Voting On

Anonymous
15 years ago
Using empty() in the previous example posted by Anonymous will result in a "Fatal error: Can't use function return value in write context". I suggest using count() instead:

<?php
function is_assoc($array) {
return (
is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));
}
?>

<< Back to user notes page

To Top