PHP连接echo中的图像链接 [英] PHP Concatenating of image link in echo

查看:75
本文介绍了PHP连接echo中的图像链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望回显图像,以便变量$ CatSelected将是图像的文件夹,$ char和$ i是img名称的一部分:
eg

I want to echo the image such that the variables $CatSelected will be the folder of the images and $char and $i are part of the img names : e.g

echo "<img src =\"Images/product/".$CatSelected."/".$char$i."s0.jpg"\>";


推荐答案

 echo "<img src =\"Images/product/".$CatSelected."/".$char.$i."s0.jpg\"\>";
                                                          ^          ^

1)你忘了连接 $ char $ i

2)你忘了逃避双引号。

2) You forgot to escape the double quotes.

这篇关于PHP连接echo中的图像链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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