function is_associative($array)
{
$count = count($array);
for ($i = 0; $i < $count; $i++)
{
if (!array_key_exists($i, $array))
{
return true;
}
}
return false;
}
$row = mysqli_fetch_assoc($result); // Assuming $result is the result of a query
$keys = array_keys($row);
$isAssociative = !is_numeric($keys[0]);
if ($isAssociative) {
echo "The fetched array is associative.";
} else {
echo "The fetched array is not associative.";
}