I was recently presented with a problem of organizing data I retrieved from a database into a list. I thought for a while, came up with nothing, thought some more, came up with nothing again, asked nate... and of course, nate knew... I could use explode(). Of course, I was excited about using a function called "explode". But anyway. Explode takes a given string and creates an array of strings based on a character you tell it to use as a seperator. For example, if you exploded "I am cool/awesome/yousuck" and provided the character "/", it would seperate the 3 parts into an array $array[str1], etc.

Explode looks like this...

explode(seperator, string)

I am going to present you with a hypothetical situation... A school faculty site system that allows teachers to input the courses they teach, seperated by commas. These courses are stored in database in a field for retrieval at a later point in time. Now the object is to retrieve the information and organize it so that each course is a list item.

So first were going to query the database for the courses by the name of the teacher (which is in the url).