Tuesday, November 13, 2007

Preg_replace

    $filecontent = str_replace("<h2>Fig","<h2 style='display:none'>Fig",$filecontent);
    $filecontent = str_replace("<h4><fn><p>","<fn><p>",$filecontent);
    $filecontent = str_replace("</fn></h4></p>","</p></fn>",$filecontent);
    $filecontent = str_replace("<li><p>","<li>",$filecontent);
    $filecontent = str_replace("</p><br /></li>","<br /></li>",$filecontent);
    $filecontent = str_replace(".jpg",".gif",$filecontent);
    $filecontent=preg_replace("/\<div class=\"fig\" >(.*?)<\/div>/","",$filecontent);
    $filecontent=preg_replace("/\<h2 style='display:none'>Fig.(.*?)<\/h2>/is","",$filecontent);
   
    $filecontent=preg_replace("/\<br \/><b>(.*?)<\/b><br \/>/is","<p><h2>\\1</h2></p>",$filecontent);
    $filecontent=preg_replace("/\<br \/><b>(.*?)<\/b><br \/>/is","<p><h2>\\1</h2></p>",$filecontent);
    $filecontent=preg_replace("/\<xyz>(.*?)<\/xyz>/is","<h6>\\1</h6>",$filecontent);
    $filecontent = str_replace("<xyz>","",$filecontent);
    $filecontent = str_replace("</xyz>","",$filecontent);
    $filecontent = str_replace("<abcd>","<br /><br />",$filecontent);

No comments:

Post a Comment