PHP interview test - Future reference, how would you do the following?
===

I had an interesting interview question for a job the other day. I failed on the question, which was a shame! But for my future knowledge, how you you guys have approached this one?

![enter image description here][1]


  [1]: http://i.stack.imgur.com/pUxrL.png