我从 php 中的 file_get_contents()
函数获取文件内容,我想将该文件存储在特定文件夹中。我该怎么做?
$image = file_get_contents('http://www.affiliatewindow.com/logos/1961/logo.gif');
我想将此图像保存在特定文件夹中。
有什么想法吗?
最佳答案
$image = file_get_contents('http://www.affiliatewindow.com/logos/1961/logo.gif');
file_put_contents('./myDir/myFile.gif', $image);
关于PHP : get file contents and store file in particular folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2729143/