How do i replace -
with –
using php htmlspecialchars()
$content = $_POST['content'];
How do i replace -
with –
using php htmlspecialchars()
$content = $_POST['content'];
You don't, -
is not a special character and as such will not be touched by htmlspecialchars()
. And -
is not even same as –
(- vs. –).
You can use str_replace()
if you want to:
$content = str_replace('-', '–', $_POST['content']);