HP does not have a built-in method to determine whether to index an array. It simply implements one. Usage:
Copy code The code is as follows:
echo is_assoc($array)?'Index array':'Not an index array';
The is_assoc function is as follows:
Copy code The code is as follows:
function is_assoc($array) {
if(is_array($array)) {
$keys = array_keys($array);
return $keys! = array_keys($keys);
}
return false;
http://www.bkjia.com/PHPjc/327562.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327562.htmlTechArticleHP does not have a built-in method to determine whether to index an array. We simply implemented one. Usage: Copy the code. The code is as follows: echo is_assoc ($array)?'Index array':'Not an index array'; is_assoc function...