Home  >  Article  >  Backend Development  >  Problem with downloading remote files in php

Problem with downloading remote files in php

WBOY
WBOYOriginal
2016-09-03 00:14:101067browse

At first, I used curl to obtain it, which is definitely feasible. Then I found that fopen() can also write URLs, and later I found that readfile() seems to be able to do it too.

So I would like to ask which method is generally used to download files? What are the advantages and disadvantages of these methods?

Reply content:

At first, I used curl to obtain it, which is definitely feasible. Then I found that fopen() can also write URLs, and later I found that readfile() seems to be able to do it too.

So I would like to ask which method is generally used to download files? What are the advantages and disadvantages of these methods?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn