WordPress Code Snippets

A fresh mix of code snippets and tutorials

PHP foreach loop

226

I am always using this PHP code snippet, which basically loops through an array that may or may not include nested arrays. So to make things easier, I am posting here for quick reference.

This code loops through the $array and checks to see if the value if each key also is an array. If so, it loops through that array as well. Basic, but frequently used.


Show Support

Like our new Facebook Page to show support!