Chris92 0 Posted December 26, 2009 Report 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 Quote Link to post Share on other sites
murfitUK 0 Posted December 27, 2009 Report 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? Quote Link to post Share on other sites
Chris92 0 Posted December 28, 2009 Author Report 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?? Quote Link to post Share on other sites
Synook 47 Posted December 28, 2009 Report 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 '>' Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.