Jump to content

Possible error in PHP htmlentities() Function


scotty86

Recommended Posts

Hello,

I might have found a little mistake here: https://www.w3schools.com/php/func_string_htmlentities.asp

You state:
ENT_QUOTES - Encodes double and single quotes

Which is correct. But in the examples it says:

<?php
$str = "My name is Øyvind Åsane. I'm Norwegian.";
echo htmlentities($str, ENT_QUOTES, "UTF-8"); // Will only convert double quotes (not single quotes), and uses the character-set Western European
?>


ENT_QUOTES must be replaced by ENT_COMPAT?

Greetz,
scotty86

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...