【发布时间】:2016-03-18 09:54:47
【问题描述】:
我想打印一个图像 url,但它给了我特殊字符。我尝试了file_get_contents - Special characters in URL - Special case 中的所有解决方案,但都没有解决。
我的代码:
$urlgeo = "http://geodata.nationaalgeoregister.nl/top25raster/wms?request=GetMap&service=WMS&version=1.3.0&request=GetMap&layers=top25raster&styles=&bbox=146000,451000,149000,454000&width=600&height=600&srs=EPSG:28992&format=image/png";
print file_get_contents($urlgeo);
【问题讨论】:
-
可以base64编码,比如
... base64_encode(file_get_contents($urlgo)); -
您不是在打印 URL,而是在打印内容。
-
这也给出了特殊字符而不是我的图片网址
标签: php character-encoding file-get-contents