View Full Version : Vb-style "replacements"
Gamefreak
Sun 12th May '02, 4:30pm
I am making a template-based web site, and I would like to know how vbulletin replaces the replacements so quickly. I can use "eregi_replace()", but it takes a while. Can anyone help me?
Mark Hensler
Sun 12th May '02, 8:49pm
I'm not familiar with vB coding, so I can't comment on that. But..
eregi() is slower than preg_replace()
and even faster is str_replace()
Gamefreak
Sun 12th May '02, 10:02pm
Thanks for the help anyways.
Chen
Mon 13th May '02, 8:26am
$formattedText = str_replace('{replacementvariable}', '#000000', $text);
You can also use arrays with str_replace(), check out the PHP docs for more info.
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.