preg_match question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kaily
Forum Newbie
Posts: 12
Joined: Fri Jul 05, 2002 12:17 pm

preg_match question

Post 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);
Post Reply