Looking for documentation? Take a look on our wiki
$text = str_replace(array(" ","\n", "\t", "\r"), '', $text);