note 35835 added to function.strtr

From: Date: Tue, 16 Sep 2003 14:21:22 +0000
Subject: note 35835 added to function.strtr
Groups: php.notes 
Request: Send a blank email to php-notes+get-56572@lists.php.net to get a copy of this message
strtr() seems terribly slow - I tried using it to replace "@@SOMETHING@@" tokens in a semi-large string with a "translation array" as parameter. I expected it to be MUCH faster than ie. preg_replace( '/(@@\w+@@)/e','$translationArray["$1"]',$string), but when I timed 10000 calls to this function, strtok() about eight times slower? ---- Manual Page -- http://www.php.net/manual/en/function.strtr.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35835 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35835&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35835&report=yes

« previous php.notes (#56572) next »