devdavad Posted December 23, 2008 Share Posted December 23, 2008 I want to make a charlist that will add a \ to these characters: "&<>[]/\'"#$@" to be used in the addcslashes() function but I'm not exactly for sure how to format it. If you are not for sure how one would go about making this kind of charlist do you know where I could find more information on it? For example on the php.net page http://us2.php.net/manual/en/function.addcslashes.php it gives an example that addcslashes("aBc[]", "A..z") will return \a\B\c\[\] but I'm not exactly for sure why the range of A..z would include the [] symbols. Link to comment https://forums.phpfreaks.com/topic/138144-solved-help-with-addcslashes/ Share on other sites More sharing options...
ratcateme Posted December 23, 2008 Share Posted December 23, 2008 it works out the range based on the ascii table so uppercase A through lowercase z includes some strange characters in the middle. Scott. Link to comment https://forums.phpfreaks.com/topic/138144-solved-help-with-addcslashes/#findComment-722117 Share on other sites More sharing options...
devdavad Posted December 23, 2008 Author Share Posted December 23, 2008 it works out the range based on the ascii table so uppercase A through lowercase z includes some strange characters in the middle. Scott. Great thank you very much! Do you know how I could skip characters in a certain range (or how to select individual characters)? Link to comment https://forums.phpfreaks.com/topic/138144-solved-help-with-addcslashes/#findComment-722119 Share on other sites More sharing options...
ratcateme Posted December 23, 2008 Share Posted December 23, 2008 you can use addcslashes($string,"&<>[]/\\'\"#$@"); you don't need to use ranges Scott. Link to comment https://forums.phpfreaks.com/topic/138144-solved-help-with-addcslashes/#findComment-722122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.