If I Save the output as html file and open in ie it shows quite ok ... but look at the mess above

First thing is the space between lines, It shouldn't be that big ...

Then Somewhere after 'case $char = '>' the font changes to strikethrough [Confused]
_________________________