plznty Posted April 8, 2011 Share Posted April 8, 2011 How can I make it so only A-Z and 0-9 "-" "@" "," "."s work and the rest of the characters are deleted from my string/variable. Link to comment https://forums.phpfreaks.com/topic/233110-strip-characters-from-a-variable/ Share on other sites More sharing options...
dcro2 Posted April 8, 2011 Share Posted April 8, 2011 $string = preg_replace("/[^a-z0-9-@,.]/i", "", $string); Link to comment https://forums.phpfreaks.com/topic/233110-strip-characters-from-a-variable/#findComment-1198868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.