This is one way.
foreach (array_keys($array) as $key) {
if(is_int($key)) {
}
}
EDIT
Depending on the size of your array, there may be faster and more memory instead. However, it requires the keys to be in order, and none of them are missing.
for($i=0;isset($array[$i]);$i++){
}
source
share