You are here: Re: Regex Not = « All PHP « IT news, forums, messages
Re: Regex Not =

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация