View Single Post
Old 01-02-2008, 08:35 PM   #4 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

This is more of a general comment than anything particularly specific to templating but remember that str_replace can accept arrays for the first three arguments (respectively: search, replace, subject). This saves the overhead of calling the same function more than once in succesion, and prevents you from repeating code unnecessarily. More simply, you could use:

PHP Code:
$html = str_replace(array('%fname%', '%lname%'), array($firstname, $lastname), $html);
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
sjaq (01-03-2008)