Re: Extracting HTML from a file

From: Date: Tue, 20 May 2003 07:54:34 +0000
Subject: Re: Extracting HTML from a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148264@lists.php.net to get a copy of this message
Hi, Tuesday, May 20, 2003, 5:37:16 PM, you wrote: S> Hi, S> using the following code I am extracting any HTML from a file which occurs S> between the two tags <!-- beginIsEditable --> and <!-- endIsEditable --> S> preg_match_all('|<!-- beginIsEditable -->(.*?)<!-- endIsEditable S> -->|is', S> implode('', file('../'.$_GET[file_name])), S> $matches = array(), S> PREG_SET_ORDER); S> $script = stripslashes(htmlentities($matches[0][0])); S> How can I modify this so that it extracts the HTML between these tags, S> rather than the HTML including these tags? S> Thanks for your help do print_r($matches); and you should see what you need. (You will need to look at the source code of the html page) -- regards, Tom

« previous php.general (#148264) next »