Jump to content

Trouple With The Pound Sign (£)


Chris92

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 comment
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 comment
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 comment
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 comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...