Posted by Jasen Betts on 02/19/06 03:34
On 2006-02-18, MS <nospamplaesegr8t_ukuk@yahoo.co.uk> wrote:
> This should be quite easy for those in the know about Regex...
>
> I have $field
>
> Which contains anything... but I want to remove everything that is not
> a-zA-Z0-9 or a space...
>
> so
>
> $field = "^&()(%Hello ^*(><><%${}world";
>
> using a regex to format
>
> $output = "Hello World";
>
> Thnx in advance !!
replace everything you don't want with nothing...
$output=ereg_replace('[^a-zA-Z0-9 ]','',$field);
It's that easy.
--
Bye.
Jasen
Navigation:
[Reply to this message]
|