PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
There's alot wrong with your code. For starters, you haven't closed your double quotes after you set a string to $str, and you're trying to explode on something which doesn't exist in your string.
Anyway, you will need a regexp pattern for what you are doing. It could probably be done with explode, but it's going to be long winded and a much worse alternative to a regex solution.
I would advise to either read the stickies in the Regular Expressions forum, or wait patiently and hope someone who is half decent at making regexp patterns is feeling generous enough to do it for you.