使用文件放置内容保存内容
我正在尝试获取 google steetview 瓷砖并保存它们。但 file_get_contents 不喜欢我的网址:
这是我的代码:
$img = "http://cbk0.google.com/cbk?output=tile&panoid="+$panorama_id+"&zoom=3&x="+$i+"&y='"+$x+"'";
$url = ""+$panorama_id+"Xval"+$i.+"Yval"+$x+".jpg";
file_put_contents($url, file_get_contents($img));
i'm trying to get google steetview tiles and save them. But file_get_contents doesn't like my url:
here's my code:
$img = "http://cbk0.google.com/cbk?output=tile&panoid="+$panorama_id+"&zoom=3&x="+$i+"&y='"+$x+"'";
$url = ""+$panorama_id+"Xval"+$i.+"Yval"+$x+".jpg";
file_put_contents($url, file_get_contents($img));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用
+
进行串联。那不是 PHP。您需要使用点.
运算符:请参阅字符串运算符< PHP 手册中的 /a> 。
或者,使用双引号字符串时,将解析字符串内的变量。 请参阅字符串类型的手册页。
You're using
+
for concatenation. That's not PHP. You need the dot.
operator instead:See string operators in the PHP manual.
Alternatively, with double quoted strings, variables within the string will be parsed. See the manual page for the string type.