在字符串中使用htmlentities

1 php html-entities

我知道我应该对所有表单文本输入字段使用htmlentities但这不起作用:

<?php
echo "<tr>
        <td align=\"right\">".Telephone." :</td>    
        <td><input type=\"text\" name=\"telephone\" size=\"27\"
            value=\"htmlentities($row[telephone])\"> Inc. dialing codes
        </td>    
</tr>";
?>
Run Code Online (Sandbox Code Playgroud)

它只是在表格中将输入值显示为"htmlentities(0123456789)"?我做错了什么?

wor*_*ad3 5

尝试使用

value=\"" . htmlentities($row[telephone]) . "\"
Run Code Online (Sandbox Code Playgroud)

那里.目前,您的字符串只包含htmlentities字符串并将变量拼接在其中.您需要输出字符串,调用函数并将其结果放置到位,如上所述.