duanmianzhou5353 2010-12-20 21:26
浏览 25
已采纳

具有常规文本的回声数组

How would I write this so I'm only using one echo?

echo "<div class='post'>";
echo $row['title'];
echo "</div>";

I'm using an array to echo out a table's values but it would be a lot easier on the eyes if I could combine these into one echo statement. However, when I try to the page goes blank.

  • 写回答

6条回答 默认 最新

  • dqwd71332 2010-12-20 21:30
    关注

    Enclose the array reference in brackets:

    echo "<div class='post'{$row['title']}</div>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?