Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 同时使用stripslashes和html_entity_解码_Php - Fatal编程技术网

Php 同时使用stripslashes和html_entity_解码

Php 同时使用stripslashes和html_entity_解码,php,Php,这样做正确吗?有人能证实吗?非常感谢 如果您要做的是解码HTML实体,然后去除斜杠,那么是的,它会这样做 首先,为什么斜杠在那里?从您的问题中,我可以推断出您正在寻找清理数据,以便转义所有特殊字符并存储在db中?假设是这样,如果您使用的是PHP5.2或更高版本,请查找php $this->car_features = stripslashes(html_entity_decode($rows['features']));

这样做正确吗?有人能证实吗?非常感谢

如果您要做的是解码HTML实体,然后去除斜杠,那么是的,它会这样做


首先,为什么斜杠在那里?

从您的问题中,我可以推断出您正在寻找清理数据,以便转义所有特殊字符并存储在db中?假设是这样,如果您使用的是PHP5.2或更高版本,请查找php

$this->car_features = stripslashes(html_entity_decode($rows['features']));