thanks both of those help.
heres another problem
i have sample data here
$data="<html><head><!-- BEGIN date-->Wednesday, November 12, 2003<!-- END date --></head></html> ";
i want to be able to just have the code date displayed along with the replacents for begin date and end date
heres how im replacing those
$date = preg_replace("/<!--\s?BEGIN date\s?-->(.+)<!--\s?END date\s?-->/i","<pubdate>$1</pubdate>",$data);
here is the output
<html><head><pubdate>Wednesday, November 12, 2003</pubdate></head></html>
here is what i need
<pubdate>Wednesday, November 12, 2003</pubdate>