Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: six plus zero?
(Example: nine)

The Note You're Voting On

Anonymous
20 years ago
If you are going to call strtr a lot, consider using str_replace instead, as it is much faster. I cut execution time in half just by doing this.

<?
// i.e. instead of:
$s=strtr($s,$replace_array);

// use:
foreach($replace_array as $key=>$value) $s=str_replace($key,$value,$s);
?>

<< Back to user notes page

To Top