mi è toccato fare

str_replace(" ","",$stringa);

funziona..ma spero non crei problemi