$t_arr = $vbulletin->templatecache; $t_keys = array_keys($t_arr); $count = count($t_keys); for ($n = 0; $n < $count; $n++) { if (strpos($t_arr[$t_keys[$n]], '<html') !== false) { $vbulletin->templatecache[$t_keys[$n]] = str_replace("<html", "<html tag='test'", $vbulletin->templatecache[$t_keys[$n]]); } }