douliao8402 2015-05-18 15:31
浏览 775
已采纳

使用URL作为HTML <img src />

I'm trying to use a URL which just contains an image to use the image on my site. I am using PHP, this is my code:

Echo '<img src= "$link["Image_Link"]"  />';`

$link["Image_Link"] points to this link.

I also have many similar links which contain different images, and are called like this one. When I call this on my site I just get a broken image symbol where the real image should be.

  • 写回答

2条回答 默认 最新

  • dt4320279 2015-05-18 15:36
    关注

    Single and double quotes are not interchangable in PHP.

    This should work:

    Echo "<img src='$link[Image_Link]' />";
    

    or

    Echo '<img src="' . $link["Image_Link"] . '" />';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样