在PHP中如何插入HTML代码块
我用PHP从mysql中查询记录然后想把不同字段显示在表单中的不同的text中,并且可以更新数据。
想插入一个比较复杂的表单,用echo太容易出错,各位大神,有没有其他办法可以实现啊,跪求!
------解决方案--------------------
晕。。我又把简单问题复杂化了。。输出大段html代码可以这样做:
PHP code1 2 3 4 5 6 | $ar = array ( 'demo' => '111' , 'test' => '222' ); $html = <input type= "text" value= "{$ar['demo']}" ><br> <input type= "text" value= "{$ar['test']}" ><br> HTML; echo $html ;<div class = "clear" >
</div>
|
Copier après la connexion