为了账号安全,请及时绑定邮箱和手机立即绑定

下面这个html字符串,如何用php的 echo或print来输出?

下面这个html字符串,如何用php的 echo或print来输出?

PHP
慕容3067478 2019-03-10 08:28:19
下面这个html字符串,如何用php的echo或print来输出? <td width=275><input type="text" name="title" value="<?php echo $row['title']; ?>"></td> echo "<td width=275><input type="text" name="title" value="<?php echo $row['title']; ?>"></td>" 不可以 echo '<td width=275><input type="text" name="title" value="<?php echo $row['title']; ?>"></td>' 也不可以 print <<<EOT <td width=275><input type="text" name="title" value="<?php echo $row['title']; ?>"></td> EOT; 也不可以,应为,这段html还包含php语句。 我的真实需求是 <?php if(isset($_POST['flag']) { print <<<EOT <td width=275><input type="text" name="title" value="<?php echo $row['title']; ?>"></td> EOT; else { } ?>
查看完整描述

3 回答

?
明月笑刀无情

TA贡献1828条经验 获得超4个赞

//方法1
echo '<td width=275><input type="text" name="title" value="'.$row['title'].'"></td>';

//方法1变形体
$a = '<td width=275><input type="text" name="title" value="';
$a .= $row['title'];
$a .= '"></td>';
echo $a;

//方法2
echo
<<<EOT
<td width=275><input type="text" name="title" value="{$row['title']}"></td>
EOT;
查看完整回答
反对 回复 2019-03-18
  • 3 回答
  • 0 关注
  • 779 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信