PHP的新功能,并发现一个可以从Twitter API中检索JSON数据并将其回显出来的可靠代码。下面是检索@Guardian的用户照片(报纸)回声图像 - PHP和JSON - Twitter的API
<?php
$data = json_decode(file_get_contents('https://api.twitter.com/1/users/lookup.json?screen_name=guardian'), true);
echo $data[0]['profile_image_url'];
?>
对图像的JSON数据是PHP代码:
profile_image_url “:” http://a0.twimg.com /profile_images/1857791844/G_twittermain_normal.jpg”
所以,很显然它呼应的URL(文字),我想输出的实际图像,可能有超过它的尺寸控制得如果可能的话。
在此先感谢!
?或者想要保存在您的服务器上前调整 – GBD