Extracting Data from a URL output
| From: | Chris Aitken | Date: | Wed, 17 Jan 2001 22:50:54 +0000 |
| Subject: | Extracting Data from a URL output | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35225@lists.php.net to get a copy of this message | ||
I have a bit of a question which ive tried to look into, but I cant seem to find the right commands to check into or what the best method of attack it.
Basically, I want to grab a URLs data, make the data a string (which im doing with fopen and fread).
But now I have the entire html as a string, Im confused as to how I best attack stripping just the data I need out of it. There is alot of stuff at the top of this particular page before the actual content starts.
Is there anyone who has some examples of how they have attacked this type of task, or even just point me in the direction of how to start ?
I have tried to utilise strstr() but because there is no real comon thread starting off the data I need, I cant really use it properly.
There is always a common word in the data (its a local weather output).
For example, today it was -
...size=4 color=white>Todays weather will be 28 degrees in Sydney</font>......
with a whole bunch of other site crap up the top. What im trying to do is simple extract everything between the > and the < wherever the word weather appears (its the common word) and its totally baffling me.
Any help would be great.
Chers
Chris