Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 文件获取url上重定向的内容_Php_Codeigniter - Fatal编程技术网

Php 文件获取url上重定向的内容

Php 文件获取url上重定向的内容,php,codeigniter,Php,Codeigniter,我在一个图像url上使用了file\u get\u contents(),它会重定向到另一个图像url。这导致PHP错误文件获取内容(www.modernpads.info/p/2161621.jpg)[function.file get contents]:无法打开流:没有这样的文件或目录 即使初始url重定向到另一个url,是否有办法获取该图像文件 如果上述操作无法完成,我怎么能不返回PHP错误而直接忽略它呢 重定向不是你的问题;URL似乎缺少http方案。没有这个方案,PHP认为它是一个文

我在一个图像url上使用了
file\u get\u contents()
,它会重定向到另一个图像url。这导致PHP错误
文件获取内容(www.modernpads.info/p/2161621.jpg)[function.file get contents]:无法打开流:没有这样的文件或目录

  • 即使初始url重定向到另一个url,是否有办法
    获取该图像文件
  • 如果上述操作无法完成,我怎么能不返回PHP错误而直接忽略它呢

  • 重定向不是你的问题;URL似乎缺少
    http
    方案。没有这个方案,PHP认为它是一个文件。

    重定向不是你的问题;URL似乎缺少
    http
    方案。如果没有这个方案,PHP认为它是一个文件