Sanitizing user's data in GET by PHP

前端 未结 5 945
情歌与酒
情歌与酒 2020-11-28 18:58

How do you sanitize data in $_GET -variables by PHP?

I sanitize only one variable in GET by strip_tags. I am not sure whether I should

5条回答
  •  独厮守ぢ
    2020-11-28 19:38

    Use a PHP native function filter_var() with FILTER_SANITIZE_STRING filter.

    Example: https://www.w3schools.com/php/filter_sanitize_string.asp

提交回复
热议问题