php remove enter from string code example Example: php remove enter from string $_result = trim(preg_replace('/\s+/', ' ', $original_text));