tab_templates[$place_holder]; if($selected) { $replacement =<<$tab_name EOF; $content = str_replace($place_holder, $replacement, $content); } else { $replacement =<<$tab_name EOF; $content = str_replace($place_holder, $replacement, $content); } } function foo() { } } $SecondGlobal = "Second Global"; $ThirdGlobal = 3;