Reply to Re: Removing numbers in brackets?

Your name:

Reply:


Posted by Justin Koivisto on 10/21/84 11:36

enterthe@walla.com wrote:
> Hi,
>
> How do I remove 4 digit numbers enclosed in brackets from a string?
> e.g. (2006)
>
> I#m currently using
>
> $s = ereg_replace('/\(\d\d\d\d\)/', "", $s);
>
> but that does not seem to work.
>
> Kind Regards,
>
> Enter The
>

you're using a perl regex pattern with ereg... change it to preg_replace
and all should be good:

$s = preg_replace('/\([0-9]{4}\)/','',$s);

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

[Back to original 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

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