Re: Web fetching script

From: Date: Mon, 27 Aug 2001 07:58:01 +0000
Subject: Re: Web fetching script
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-64592@lists.php.net to get a copy of this message
On Mon, 27 Aug 2001 17:10, Ben Quinn wrote: > G'day Guys > > Sorry, i should have explained it better. What i want to do is grab 2 > different lots of text from the same page. Say the page had this text > > 10am > Some text > 12pm > Different text > 2pm > > I want to be able to grab from say 10am to 12pm and store it in $texta > and then grab from 12pm to 2pm and store it in $textb - but with the > script i've pasted below i can only grab one lot of text at a time! to > grab 2 lots of text from the same page i have to have 2 scripts and in > the end i've opened up and closed the page twice! Anyway, any help i > can get will be much appreciated > > This is the script i'm using > <? > > $GrabURL = "url.txt"; > $GrabStart = "start"; > $GrabEnd = "stop"; > > $file = fopen("$GrabURL", "r"); > $rf = fread($file, 20000); > $grab = eregi("$GrabStart(.*)$GrabEnd", $rf, $printing); > > $printing[1] = str_replace("replacedatestamp", "withnewstamp", > $printing[1]); Here, reset your start and finish criteria and do the eregi again, assigning the result to $grab2. > > fclose($file); > echo $printing[1]; > > ?> Unless I'm missing what you're trying to do, of course. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Manure Occurs.

« previous php.general (#64592) next »