0

When I insert an accented letter as "è à ù" the function does not work, it does not return anything, why?

$test = "è ò ù";
echo htmlspecialchars($test, ENT_QUOTES, 'UTF-8');

1 Answers1

0

Use below code

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
$test = "è ò ù";
echo htmlspecialchars($test, ENT_QUOTES, 'UTF-8');
?>
Brijal Savaliya
  • 1,101
  • 9
  • 19