Chris92 Posted December 26, 2009 Share Posted December 26, 2009 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 More sharing options...
murfitUK Posted December 27, 2009 Share Posted December 27, 2009 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 More sharing options...
Chris92 Posted December 28, 2009 Author Share Posted December 28, 2009 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 More sharing options...
Synook Posted December 28, 2009 Share Posted December 28, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.