How do you test it for sure?
<?php
function htmlsan($htmlsanitize){
return $htmlsanitize = htmlspecialchars($htmlsanitize, ENT_QUOTES, 'UTF-8');
}
var_dump(htmlsan('<>\'"'));
... prints:
string(20) "<>'""
I assume your input line comes from Microsoft Word and contains typos:
var_dump(htmlsan('"foo"')); // string(9) ""foo""
If you need to convert them for any reason, you need htmlentities(), not htmlspecialchars():
var_dump(htmlentities('"foo"', ENT_QUOTES, 'UTF-8')); // string(17) "“foo”"
Update # 1
, . (') comment :
var_dump(bin2hex("'"));
var_dump(htmlspecialchars("'", ENT_QUOTES, 'UTF-8'));
var_dump(bin2hex($row['comment']));
var_dump(htmlspecialchars($row['comment'], ENT_QUOTES, 'UTF-8'));
:
string(2) "27"
string(6) "'"
string(2) "27"
string(6) "'"
, , .
# 2
, , , , :
string(6) "'"
6 . real: . , , .. string(6) "'". ' -, '. " " , .