Check if an array is associative or sequential in PHP?
Answer:
In PHP, if you want to check if a given array variable is associative or sequential, you can use the following method:
<?php
$list = array(1, 2, 3, 4, 5);
$is_sequential = array_values($list) === $list;