php 中 传数据
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
到前端 用textarea 显示
再从前端post 数据回来
使用echo $this->input->post ('content');
为何值为:
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>第一个 < post回来为什么变成了 < ?html 转义字符
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
到前端 用textarea 显示
再从前端post 数据回来
使用echo $this->input->post ('content');
为何值为:
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>第一个 < post回来为什么变成了 < ?html 转义字符
<body>
<?php
$str='
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don\'t forget the meeting!</body>
</note>'
;var_dump($_POST);
?>
<form method="post">
<textarea name='test'> <?php echo $str ;?> </textarea>
<input type="submit" />
</form>
</body></html>
没有你说的情况
< ?xml versi encoding="ISO-8859-1"?>
<note>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
EOF;echo htmlspecialchars_decode($str);