Html 如何在输入标记中显示双引号?

Html 如何在输入标记中显示双引号?,html,input,Html,Input,如何在输入标记中显示双引号 我的$test是i测试“hello” 像这样输入 <input name="test" type="text" value="<?PHP echo $test; ?>"> 使用html\u entity\u decode,因为您使用的是php如下: 尝试使用或 对值属性使用单引号value=''我想你的意思是htmlentities()。不。这正是我的意思。因为htmlentities是它的对立面,最后一个echo将产生value=“i t

如何在输入标记中显示双引号

我的
$test
i测试“hello”

像这样输入

<input name="test" type="text" value="<?PHP echo $test; ?>">

使用
html\u entity\u decode
,因为您使用的是
php
如下:

尝试使用或



属性使用单引号
value=''
我想你的意思是
htmlentities()
。不。这正是我的意思。因为
htmlentities
是它的对立面,最后一个
echo
将产生
value=“i test”hello”“
,所以这不起作用。
<input name="test" type="text" value="<?php echo htmlspecialchars($test); ?>">

<input name="test" type="text" value="<?php echo htmlentities($test); ?>">
<?php echo '<input name="test" type="text" value="'.$test.'">'; ?>