Dealing with sparse arrays


/ Published in: PHP
Save to your folder(s)

This snippet assumes you want to walk the numbered array items only, as you would with a normal for loop, but a for loop up to count($array) won't work with a sparse array because the highest array index will always be higher than the array count.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.