Strip out HTML and Special Characters

后端 未结 9 1301
别跟我提以往
别跟我提以往 2020-12-07 12:39

I\'d like to use any php function or whatever so that i can remove any HTML code and special characters and gives me only alpha-numeric output

$des = "He         


        
9条回答
  •  执念已碎
    2020-12-07 13:07

    You can do it in one single line :) specially useful for GET or POST requests

    $clear = preg_replace('/[^A-Za-z0-9\-]/', '', urldecode($_GET['id']));
    

提交回复
热议问题