Page 1 of 1

preg_match question

Posted: Thu Aug 15, 2002 2:45 pm
by kaily
I want to get some content from a html file,for example I want to get the content(with the HTML code) between <!--ASDF--> and <!--FDSA--> in the following code

Code: Select all

<html>.....
  <!--ASDF-->
    <table>
      <tr>
        <td>TEST</td>
     </tr>
    </table>
  <!--FDSA-->
......
</html>
I use the following code but i doesn't work,plz help me!
preg_match("/\<!--ASDF--\>\s*(.*?)\s*\K!--FDSA--\>/",$string,$result);