str_replace will take arrays for "before" and "after" sequences. So, build arrays, and do ONE str_replace and Bob's your uncle. Another option, a bit crude, but effective, would be to wrap your template-y bit in a function that calls 'extract' on an array of variable names. class Template_thingie { private $vars = array(); public function template_register_variable($varname){ $vars[] = $varname; } function template_render_whatsit(){ extract($vars); include("some_file_$foo_here.php"); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php