views:

23

answers:

1

Hi everyone, I'm trying to replace video{79345394} (random number inside the brackets) with a link. So far I have...

preg_replace('@video[{]([0-9])[}]@', $language[61].'<br /><a href="javascript:videoWith($1);">'.$language[62].'</a>', $chat_message);

It doesn't seem to be working, so help is very much appreciated!

A: 

Nevermind! I just needed to add a {10}, so...

[0-9]{10}
Chris
You should rather do [0-9]{1,10} unless you are certain that your number will is 10 digits long.
Guillaume Bodi