I have a form.
I use htmlspecialchars
so when user submits the form,
// $_POST['test']; equals to "> 5"
$test = htmlspecialchars($_POST['test'], ENT_QUOTES);
...
$stmt->bindParam(':test', $test);
...
When I pull it from the database, it is like this:
This does not work:
if($row['test'] == '> 5') {
echo $row['test']; // "< 5"
}
This works:
if($row['test'] == '> 5') {
echo $row['test']; // "< 5"
}
How can I make it work with this: if($row['test'] == '< 5')
and not > 5
? I still want to use htmlspecialchars
.