Thanks guys, it has started to get me on my way. I have now found that the files contains multiple html references. Would it simply be a matter of just changing the if to a while.
Anonymous Monk,
No - you should not try to roll your own unless you are 100%
sure of your data. That is what I was trying to point out.
Follow tall_man's advice or find a module you like using
the search I provided.