如何显示图片而不是网址?
echo "<b>Image: </b> http://graph.facebook.com/" . $posts['from']['id'] ."/picture?type=large</br>";
答案 0 :(得分:1)
只需使用<img>
标记并将src
设置为您的网址:
echo "<b>Image: </b> <img src='http://graph.facebook.com/"
. $posts['from']['id'] ."/picture?type=large'></br>";
答案 1 :(得分:0)
尝试:
echo "<b>Image: </b><img src='http://graph.facebook.com/" . $posts['from']['id'] ."/picture?type=large'/></br>";
答案 2 :(得分:0)
<img src="http://graph.facebook.com/".$posts['from']['id']
."/picture?type=large">
这将构建正确的标记。
答案 3 :(得分:0)
echo '<b>Image: </b> <img src="http://graph.facebook.com/' . $posts['from']['id'] . '/picture?type=large" /><br />';
或者,不使用串联:
<b>Image: </b> <img src="http://graph.facebook.com/<?php echo $posts['from']['id']; ?>/picture?type=large" /><br />
或使用短标签:
<b>Image: </b> <img src="http://graph.facebook.com/<?=$posts['from']['id']?>/picture?type=large" /><br />