Recent code example

Writing PHP to be viewed by others needs practice.

Also, I think using "return" more wisely will free up the for loop.