This library provides a single function that determines if an array should be considered sequential.
You can install is_sequential with Composer:
composer require simoneddy/is_sequential
Alternatively you can clone/download this repository and simply include src/is_sequential.php where neccessary in your project.
Once the function is accessible (either by Composer's autoloader or including the function directly), it can be used as any standard PHP function:
$myArray = [1, 2, 3];
$myOtherArray = ['test' => 1, 2, 3];
var_dump(is_sequential($myArray)); // returns true
var_dump(is_sequential($myOtherArray)); // returns false
The function is type hinted to only accept arrays, and will only ever return a boolean.