You are here: Re: parsing phone numbers « PHP Programming Language « IT news, forums, messages
Re: parsing phone numbers

Posted by Toby A Inkster on 05/09/07 14:58

Krustov wrote:

>> As far as I can tell, your entire 40-line include file can be replaced with:
>> $p = preg_replace('/[^0-9]/', '', $p);
>> which is only 40 characters.
>
> The $ok string can contain any characters and its a lot easier and
> faster to duplicate/rename the file than it is to learn expressions .

You think it's faster to duplicate, rename and modify that file than it is
to change this:

$p = preg_replace('/[^0-9]/', '', $p);

to, say, this:

$p = preg_replace('/[^AaEeIiOoUu]/', '', $p);

?!

(That regular expression removes everything except vowels.)

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

 

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

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