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 Link to comment https://forums.phpfreaks.com/topic/264372-excluding-characters-from-the-htmlspecialchars-function/ 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); Link to comment https://forums.phpfreaks.com/topic/264372-excluding-characters-from-the-htmlspecialchars-function/#findComment-1354994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.