我不知道为什么我的按钮中的第二个值没有被完全显示
<p><input type ="button" id="comment"
value=<?php echo $comment_exist == null ? 'Save' : 'Cancel my comment'; ?>></p>如果条件为真,则显示Save (如果不显示Cancel,则显示not my comment )。
你知道为什么吗?谢谢你的帮助
发布于 2014-03-15 09:07:51
你得引用你的价值观。要么单引号要么双倍。并且始终有关闭“自动关闭”标记/>的实践。
<p>
<input type ="button" id="comment"
value="<?php echo $comment_exist == null ? 'Save' : 'Cancel my comment'; ?>" />
</p>发布于 2014-03-15 09:04:56
试试这个(加引号)
<p><input type ="button" id="comment"
value="<?php echo $comment_exist == null ? 'Save' : 'Cancel my comment'; ?>"></p>发布于 2014-03-15 09:05:17
试着引用这个php代码,就像这样--它会工作的
<p><input type ="button" id="comment" value="<?php echo $comment_exist == null ? 'Save' : 'Cancel my comment'; ?>"></p>https://stackoverflow.com/questions/22421740
复制相似问题