Php 警告:文件\u获取\u内容(http://...@2x.png)[function.file get contents]:无法打开流:

Php 警告:文件\u获取\u内容(http://...@2x.png)[function.file get contents]:无法打开流:,php,javascript,html,Php,Javascript,Html,WideImage::load($category)->resize(29,28)不适用于内容为@2x的链接…我收到了这个错误 警告:文件获取内容()[function.file get contents]:无法打开流: 范例 http://myurl/icon_filter04@2x.png 当我使用不带@2x的链接时,效果非常好 这是我的密码: WideImage::load($category)->resize(29, 28)->saveToFile('img/catego

WideImage::load($category)->resize(29,28)不适用于内容为@2x的链接…我收到了这个错误

警告:文件获取内容()[function.file get contents]:无法打开流:

范例

 http://myurl/icon_filter04@2x.png
当我使用不带@2x的链接时,效果非常好

这是我的密码:

WideImage::load($category)->resize(29, 28)->saveToFile('img/category/'.$temp_name_category.'');

当路径中有这些符号时,应始终
urlencode
您的路径:

! * ' ( ) ; : @ & = + $ , / ? % # [ ]

试试看:
http://myurl/icon_filter04%402x.png

你需要逃离@,所以
http://myurl/icon_filter04%402x.png

符号是URL中的保留字符

如果URL包含
@
符号,则必须将其转义

用于安全地对URL进行编码

$safeFilename = "http://murl/".urlencode("icon_filter04@2x.png");

希望对您有所帮助。

PHP有一个内置函数;您不应该手动执行任何类型的转义。我已经尝试使用urlencode函数,但它不起作用。我也一样error@shadsauhduisad-如果将URL编码的URL放入浏览器地址字段,会发生什么情况?你能从那里访问它吗?如果链接是https?有什么问题吗?现在我得到“找不到包装器”https