<html>
<head>
<meta charset="utf-8">
</head>
<body>
$str = "My name is Øyvind Åsane. I'm Norwegian.";
echo htmlentities($str, ENT_QUOTES); // Will only convert double quotes (not single quotes), and uses the character-set Western European
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_htmlentities3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:51:06 GMT -->
</html>