basher400 Posted June 18, 2012 Share Posted June 18, 2012 hi I would like to use the htmlspecialchars but I want to exclude the & character e.g: I don't want it to change the "&" to "&" is there a way to do ? I couldn't find an answer here: http://php.net/manual/en/function.htmlspecialchars.php Quote Link to comment Share on other sites More sharing options...
scootstah Posted June 18, 2012 Share Posted June 18, 2012 Convert it back afterwards. $str = 'a string with & in it'; $str = htmlspecialchars($str); $str = str_replace('&', '&', $str); Quote Link to comment Share on other sites More sharing options...
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.