Reply to Re: using preg_replace to remove spaces as well..
Posted by Mladen Gogala on 07/08/05 13:44
On Fri, 08 Jul 2005 03:34:52 -0700, john wrote:
> I am using this to remove everything except the 0-9 and a-z characters,
> but I also want to remove blanks spaces as well(yes even ones in
> between words)
>
> $strippedtext = preg_replace('/[^0-9a-z]/i','',$originaltext);
>
> Please help.
>
$stripper=preg_replace('/\s+/','',$str);