<? //Author Mitya Aleshkovsky [email]mitya@alesh.ru[/email] function cut_html($tag,$string){ $tag=str_replace("<","",$tag); $tag=str_replace(">","",$tag); preg_match("!<$tag>(.*?)</$tag>!si",$string,$ok); return ($ok[1]); } $str="123 <body>456</body>897"; echo cut_html("body",$str); ?>