0

How do i replace - with – using php htmlspecialchars()

$content = $_POST['content'];

4

2 に答える 2

3

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']);
于 2010-12-07T12:13:48.370 に答える
1
于 2010-12-07T12:50:43.153 に答える