Date: 09/21/07 (PHP Community) Keywords: no keywords I need to remove the leading and trailing whitespace and line returns from the following variable: $section_description = "The following removes -all- whitespace: $section_description = preg_replace('/\s+/','',$section_description); echo $section_description; This has no effect: $section_description = preg_replace('/ \t\n\x0B\f\r+/','',$section_description); echo $section_description;I read that \s is synonymous with \t\n\x0B\f\r. But that doesn't appear to be the case, or I'm misunderstanding something.. Any help?
|