preg_match question
Posted: Thu Aug 15, 2002 2:45 pm
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
I use the following code but i doesn't work,plz help me!
preg_match("/\<!--ASDF--\>\s*(.*?)\s*\K!--FDSA--\>/",$string,$result);
Code: Select all
<html>.....
<!--ASDF-->
<table>
<tr>
<td>TEST</td>
</tr>
</table>
<!--FDSA-->
......
</html>preg_match("/\<!--ASDF--\>\s*(.*?)\s*\K!--FDSA--\>/",$string,$result);