将图像路径存储在变量中 [英] Storing image path in a variable

查看:118
本文介绍了将图像路径存储在变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库存储用户图像的路径,如images / profile / 950baasfaa88c.jpg。现在,当我试图把它变成一个变量,并用图像标签包围它,只有一个空白的图像不是图像本身...

I have a database that stores the path to the users image such as images/profile/950baasfaa88c.jpg. Now when i try to put this into a variable and surround it with image tags, only a blank image comes up not the image itself...

    $profile_picture = $row['profile_image'];

<img src="'.$profile_picture.'" width=50 height=50 />


推荐答案

您没有回传PHP

<img src="'.$profile_picture.'" width=50 height=50 />

应为

<img src="<?= $profile_picture ?>" width=50 height=50 />

这篇关于将图像路径存储在变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆