开发者

using stripslashes and html_entity_decode at the same time

开发者 https://www.devze.com 2023-02-19 08:29 出处:网络
$this->car_features = stripslashes(html_entity_decode($ro开发者_如何学JAVAws[\'features\']));
$this->car_features = stripslashes(html_entity_decode($ro开发者_如何学JAVAws['features']));

is this correct to do? can anyone confirm? many thanks in advance!


If what you are trying to do is decode HTML entities and then strip slashes, then yes, it will do that.

Why are slashes in there in the first place?


From your question, what I could infer is you are looking for sanitizing the data in order to escape all special characters and store in db? Assuming that as a situation, If you are using php 5.2 or above look for PHP Filters and Sanitizers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号