If the loop method is the only way, do I /have/ to loop through and tokenize? Why not this?:

Code:
echo $chan $replace($replace($rawmsg,$chr(32),$chr(160)),$chr(160),$chr(32))