|
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]
|