![]() |
|
#1
|
|||
|
|||
file retrieval....reg expression?I am trying to pull a weather report from a remote html page, and would like to know how to gather just the report ( not the whole page) for display on my own page. I have succesfully pulled the whole page into mine using the following code:
PHP Code:
And all I want is the text of the report, between the "FPAK77PAJK" and the "$$". The are so many file functions that I'm overwhelmed. Can anyone recommend a logical way to approach this? Thanks in advance. DM |
|||
|
#2
|
|||
|
|||
Solution found!A user on another forum provided me with a solution, using <pre> and </pre> tags that exist in the page, and surround the weather report.
PHP Code:
|
|
#3
|
|||
|
|||
|
Or if your not too up to date on your reg expr's and you just wanted the data inbetween the tags, without the <pre> tags you could use a more generic function, i.e:
PHP Code:
You could also have a variation of this function which spat the matched strings into an array and then return the array if need be. If my code is at all dodgy pls feel free to correct me. |
|
#4
|
|||
|
|||
Thanks.Thanks, that worked just as well. I'm just learning this stuff, but have quickly realized there are 101 ways to skin a cat in PHP. Thanks for the code, and I look forward to trying some variations of it in other situations. Thanks again. DM
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 10-Mar-2004 00:56 |
| C++ file I/O | CronoX | C++ Forum | 36 | 09-Mar-2004 18:28 |
| read specified range of lines from file | etron | C Programming Language | 8 | 18-Feb-2004 09:04 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The