allinurl Posted July 8, 2008 Share Posted July 8, 2008 Does anyone knows how can I remove all metacharacters except a dot. I just wanna leave numbers, letters, and dots e.g www.site.com Quote Link to comment https://forums.phpfreaks.com/topic/113798-remove-all-metacharacters-dot/ Share on other sites More sharing options...
effigy Posted July 8, 2008 Share Posted July 8, 2008 What metacharacters? echo preg_replace('/[^\da-z.]/', '', $string); Quote Link to comment https://forums.phpfreaks.com/topic/113798-remove-all-metacharacters-dot/#findComment-584772 Share on other sites More sharing options...
allinurl Posted July 8, 2008 Author Share Posted July 8, 2008 got it '#[^a-zA-Z0-9\.]#' Quote Link to comment https://forums.phpfreaks.com/topic/113798-remove-all-metacharacters-dot/#findComment-584777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.