foreach($myarr as $key => $item) { if(is_int($key)) {
Yes, this will go through each element of the array, so if you want to process the other elements separately, you can simply add an else to the block.
Edit: Changed is_numeric to is_int . See Comments for an explanation.
source share