beermaker74 Posted February 15, 2007 Share Posted February 15, 2007 is there a function that strips special characters. I already have it where it replaces spaces with underscores. I have been having problems with the & I am sure that there are a tremendous amount of special chars that will mess up my xml. So if there is something quick that can strip them please let me know thanks Link to comment https://forums.phpfreaks.com/topic/38627-strip-special-characters/ Share on other sites More sharing options...
Jenk Posted February 15, 2007 Share Posted February 15, 2007 htmlspecialchars() or htmlentities() Link to comment https://forums.phpfreaks.com/topic/38627-strip-special-characters/#findComment-185383 Share on other sites More sharing options...
trq Posted February 15, 2007 Share Posted February 15, 2007 You might look at using htmlspecialchars to change special characters into there html counterparts. Link to comment https://forums.phpfreaks.com/topic/38627-strip-special-characters/#findComment-185384 Share on other sites More sharing options...
php_joe Posted February 15, 2007 Share Posted February 15, 2007 you could use preg_replace() or str_replace() to remove characters that you don't want. Link to comment https://forums.phpfreaks.com/topic/38627-strip-special-characters/#findComment-185392 Share on other sites More sharing options...
beermaker74 Posted February 15, 2007 Author Share Posted February 15, 2007 is there a list of special chars that will mess up a linux system? I am creating xml with the files so I need to make sure everything is compliant. If I used str replace do I need to list every character? I was hoping there was some function that automatically did it. thanks Link to comment https://forums.phpfreaks.com/topic/38627-strip-special-characters/#findComment-185415 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.