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.'">'; ?>