Here I have a script to validate description that users pass:
if(strlen($_POST['descriprtion']) >250) {
//Some error code here
} else {
$description = $mysqli->escape_string(htmlentities(trim($_POST['description']))); }
Now, I test with the description with I'm testing
. I would give me something like this when I print out the page:
As you can see, there's a black slash before the single quote.
I was considering using stripslashes()
, but where should I use it?