RE: [PHP] Remote Files using PHP: Help Please
| From: | John Holmes | Date: | Sun, 15 Sep 2002 18:08:35 +0000 |
| Subject: | RE: [PHP] Remote Files using PHP: Help Please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116453@lists.php.net to get a copy of this message | ||
No, you have to read the whole file, and then filter out what you need
on your side. This is where you would use regular expressions.
Also, be aware of any copyright violations you may be committing, or you
could just contact the owner of the page and ask for access to this
data. Maybe they'll set up some kind of XML feed for you.
---John Holmes...
> -----Original Message-----
> From: Anthony Ritter [mailto:tony@gonefishingguideservice.com]
> Sent: Sunday, September 15, 2002 3:00 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Remote Files using PHP: Help Please
>
> Thanks for the reply John.
>
> Please let me explain further...
>
> The following is the URL:
>
>
http://waterdata.usgs.gov/ny/nwis/current?type=sw&group_key=huc_cd&searc
h_
> si
> te_no_station_nm=01427510
>
> On that page there is a real time table of water heights and water
> temperatures which get updated every four hours.
>
> However, if I use fread(), then all of the data gets transferred.
> Everything on the page.
>
> I'd like only the following string:
>
> Station Number | Station Name | Date | Time |
Gage
> Height | Temperature
> 01427510 | Callicoon, New York | 09/15 | 13:15 | 2.92
> | 19.5
>
> Is it possible to filter out *everything* but the data for the above
> record?
>
> >From there I would assume I could place this data into an array e.g.
>
> '$station_number'[]
> '$station_name'[]
> '$date'[]
> $time'[]
> $gage_height'[]
> $'temperature'[]
>
> so that this data could be placed into a html cell within the the
table
> for
> output.
>
> Please advise.
> Thank you.
> Tony Ritter
> .........................................................
>
>
> John Holmes wrote in message:
>
> > Just treat the URL like a local file:
> >
> > $fp = fopen("http://www.domain.com/file.html");
> >
> > and then fread() and parse the contents of the file.
> >
> > ---John Holmes...
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php