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

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

<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 
{

} 
?>
慕容3067478
浏览 780回答 3
3回答

明月笑刀无情

//方法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;
打开App,查看更多内容
随时随地看视频慕课网APP