Jump to content

Trouple With The Pound Sign (£)


Recommended Posts

Whenever I the try and do this to pound sign:

htmlspecialchars('£'); //something along these lines

I get returned an unknown character followed by the pound sign insted of £ , though other characters have no trouble and im now all out of ideas :) if anyone knows why or can help the please do! and hopes this makes some sense

Link to post
Share on other sites

According to the manual at http://php.net/manual/en/function.htmlspecialchars.php this function only works on a limited number of html characters and according to the note:Note: Note that this function does not translate anything beyond what is listed above. For full entity translation, see htmlentities(). Might be worth trying htmlentities() instead?

Link to post
Share on other sites
According to the manual at http://php.net/manual/en/function.htmlspecialchars.php this function only works on a limited number of html characters and according to the note:Note: Note that this function does not translate anything beyond what is listed above. For full entity translation, see htmlentities(). Might be worth trying htmlentities() instead?
ahh htmlentities() works! thanks alot :)htmlspecialchars() should work though as £ is a UTF-8 character isn't it??
Link to post
Share on other sites

htmlspecialchars(), as explained on the man page, only converts the ampersand symbol, quotes, and greater than and less than characters.

The translations performed are: * '&' (ampersand) becomes '&' * '"' (double quote) becomes '"' when ENT_NOQUOTES is not set. * ''' (single quote) becomes ''' only when ENT_QUOTES is set. * '<' (less than) becomes '<' * '>' (greater than) becomes '>'
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...