Re: Writing remote data to local file
| From: | Jason Wong | Date: | Thu, 08 May 2003 15:33:10 +0000 |
| Subject: | Re: Writing remote data to local file | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146858@lists.php.net to get a copy of this message | ||
On Thursday 08 May 2003 23:23, Dave Rosenberg wrote:
[snip]
> >>>>| $remotefile =
> >>>>fopen('http://mydomain.org/testo.html','r');
> >>>>|
> >>>>| $localfile =
> >>>>fopen('/home/dave/public_html/test.txt','w');
> >>>>|
> >>>>| fwrite($localfile,$remotefile);
> >>>>|
> >>>>| fclose($localfile);
> >>>>|
> >>>>| fclose($remotefile);
> >>>
> >>>Lookup each of the above functions in the manual and see
> >>
> >>_what arguments_ they
> >>
> >>>take and what they _return_. Then examine and try the
> >>
> >>examples given for each
> >>
> >>>of the functions and understand how they work.
> >>
> >>Obviously that's the first thing I did, but they do not offer any
> >>guidance beyond where I've gotten. I also tried this....
> >
> > Well, obviously you did not look at the right bits, so try this little
> > quiz:
> >
> > (1) what does fopen return?
> >
> > (2) what does fwrite() expect its second argument to be?
> >
> > (3) are these the same?
>
> No, or I wouldn't be asking. I was looking for some assistance.
> Judging by these two responses, I guess this is not the right place to
> ask questions?
"Give a man a fish and you will feed him for a day. Teach him how to fish and
you will feed him for a lifetime." (or something like that)
Did you try the examples in the manual, in particular the one(s) for fwrite()?
Once you get that working, modify it to suit your purpose.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
One good reason why computers can do more work than people is that they
never have to stop and answer the phone.
*/