【发布时间】:2023-03-21 22:13:01
【问题描述】:
是否有 file_get_contents 的替代方法?这是我遇到问题的代码:
if ( !$img = file_get_contents($imgurl) ) { $error[] = "Couldn't find the file named $card.$format at $defaultauto"; }
else {
if ( !file_put_contents($filename,$img) ) { $error[] = "Failed to upload $filename"; }
else { $success[] = "All missing cards have been uploaded"; }
}
我尝试使用 cURL,但无法完全弄清楚如何完成此操作。任何帮助表示赞赏!
【问题讨论】:
-
查看this answer 了解
curl_get_contents()函数。
标签: php curl file-get-contents