This is a discussion on HTTP Request within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hey peoples, Just a quick one as i dont know where to start, i have a friends website that returns ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hey peoples,
Just a quick one as i dont know where to start, i have a friends website that returns results and only results on request... so if i go to www.someplace.com/getstuff.txt It will return raw text like (no formatted code like fonts etc) username=fred age=20 hobbies=123 My question is, is it possible to request that data from my server in a php script and then load the lines one by one into a variable? Thanks if someone could point me in the right direction :) Thanks upon reply. |
|
|||
|
"Larcos" <newsgroup@larcos.com.au> wrote in message
news:<412eddde$0$25605$afc38c87@news.optusnet.com. au>... > > i have a friends website that returns results and only results > on request... so if i go to www.someplace.com/getstuff.txt > > It will return raw text like > (no formatted code like fonts etc) > > username=fred > age=20 > hobbies=123 > > My question is, is it possible to request that data from my server in a php > script and then load the lines one by one into a variable? Yes. This snippet of code: $data = file('http://www.someplace.com/getstuff.txt'); will result in $data being an array of three srtings: key value 0 username=fred 1 age=20 2 hobbies=123 Cheers, NC |