oppure con le regexp

Codice PHP:
print preg_replace("#\s#"""$string); 
mi toglie lo \ il tag php..


print preg_replace("#\s#", "", $string);