本文介绍了如何在php中回显回声?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些基本的PHP代码:
I have some basic PHP code:
$raceramps56["short"] = "My Test Product";
$leftMenu =
'<div class="leftMenuProductButton"><?PHP echo $raceramps56["short"] ?></div>';
不会显示PHP代码,仅显示元素。我尝试过
Won't echo the PHP code, only the element. I've tried things like
<div class="leftMenuProductButton">' . <?PHP echo $raceramps56["short"] ?>. '</div>';
仅返回解析错误:解析错误,意外的'<'
所以我的问题是,如何使它工作或采取另一种方法?
So my question is, how do I either get this to work, or take another approach?
推荐答案
尝试一下
$ raceramps56 [ short] =我的测试产品;
$ leftMenu ='< div class = leftMenuProductButton>'.. $ raceramps56 [ short]。'< / div>';
这篇关于如何在php中回显回声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!