pluginbaby Posted November 8, 2006 Share Posted November 8, 2006 I made an input form, but when people write some characters in there like " or ', this can cause me trouble with making sql commands.I looked for a function to remove some characters, but didn't found one. Is there a function which removes a charater you want to be removed like:you want no a in your string, and you use this function then and strips all a's from your function but leaves the rest there Link to comment https://forums.phpfreaks.com/topic/26615-handeling-quotes/ Share on other sites More sharing options...
blear Posted November 8, 2006 Share Posted November 8, 2006 [code]$cleanString = str_replace('"','',$dirtyString);[/code]Removes all doule quotes, similarly,[code]$cleanString = str_replace("'","",$dirtyString);[/code]removes all single quotes. Link to comment https://forums.phpfreaks.com/topic/26615-handeling-quotes/#findComment-121729 Share on other sites More sharing options...
pluginbaby Posted November 8, 2006 Author Share Posted November 8, 2006 thanks, it works perfectly now ;D Link to comment https://forums.phpfreaks.com/topic/26615-handeling-quotes/#findComment-121734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.