Jump to content
scotty86

Possible error in PHP htmlentities() Function

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...