Re: extract/replace the content of html pages

From: Date: Mon, 05 Jan 2004 19:26:27 +0000
Subject: Re: extract/replace the content of html pages
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-173772@lists.php.net to get a copy of this message
I will mess around with this I think that this will help me get to where I'm going. Thnaks, J. "Martin Helie" <martin@bang.ca> wrote in message news:20040103004622.21064.qmail@pb1.pair.com... > Not sure I understand, but it sounds like you'd want to do something like: > > $dir = "yourdir/"; > $d = dir( $dir ); > > while (false !== ($file = $d->read())) { > if( substr( $file, 0, 1 ) == "." ) { > continue; > } > $fp = fopen( $dir . $file, "r" ); > $contentArray = split( "<!--[a-z ]-->", fread( $fp, $file, filesize( > $dir . $file ) ) ) > //deal with $contentArray here > fclose( $fp ); > } > > Is that what you had in mind? > > > "Jlake" <jalake@idealpromotional.com> wrote in message > news:20040102224433.73796.qmail@pb1.pair.com... > > Hello > > > > I have a folder full of html pages that I need to extract the content > from. > > They all have <!-- content start --> and <!--content end --> comment tags > > surrounding the content. I need an easy way (not one at a time) to extract > > that content and place it in a new template. > > > > Any ideas are appreciated. Im assuming it will have to be some sort of > > strpos and substr thing, but I'm not sure how to automate my process > > > > Thanks, > > > > J.

« previous php.general (#173772) next »