易于修改以显示图像而不是 URL


Easy modification to show the image instead of the url

如何显示图像而不是网址?

echo "<b>Image: </b> http://graph.facebook.com/" . $posts['from']['id'] ."/picture?type=large</br>";

只需使用<img>标签,并将src设置为您的网址:

echo "<b>Image: </b> <img src='http://graph.facebook.com/"
      . $posts['from']['id'] ."/picture?type=large'></br>";

尝试:

echo "<b>Image: </b><img src='http://graph.facebook.com/" . $posts['from']['id'] ."/picture?type=large'/></br>";
<img src="http://graph.facebook.com/".$posts['from']['id'] 
         ."/picture?type=large">

这将构建正确的标记。

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 />