Ok the
$foo = preg_replace('/\W+/', '', $foo);
worked sort of. It took out all the spaces inbetween all the words as well and also removed the '<' from the html tags that were in the text like '<b>' became ' b ' . But it did at least take out the odd carriage return or line feed that I needed to get rid of.
So now can you tell me what the heck the '/\W+/' bit means and where would I look to see if 'W' was the right thing. I haven't found any decent reference to explain these pattern things and I would greatly like to understand it. Also how do I fix it so it will leave the '<b>' and the '</b>' and still take out the line feed that I don't want.
Oh and thanks.