-2

How do I show the image instead of the url?

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

4 回答 4

1

Simply use the <img> tag with src set to your url:

echo "<b>Image: </b> <img src='http://graph.facebook.com/"
      . $posts['from']['id'] ."/picture?type=large'></br>";
于 2012-06-18T12:00:30.410 回答
0

try:

echo "<b>Image: </b><img src='http://graph.facebook.com/" . $posts['from']['id'] ."/picture?type=large'/></br>";
于 2012-06-18T12:00:21.697 回答
0
<img src="http://graph.facebook.com/".$posts['from']['id'] 
         ."/picture?type=large">

这将构建正确的标签。

于 2012-06-18T12:00:48.753 回答
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 />
于 2012-06-18T12:00:52.917 回答