etrader Posted January 30, 2011 Share Posted January 30, 2011 There are good ways to keep only English characters in a string. But what is the easiest way to keep all alphabetic characters (whether in English or other languages like Russian, Japanese, etc) by removing all sign characters like !@#$%^&*()":;' ? Link to comment https://forums.phpfreaks.com/topic/226113-removing-non-alphabetic-characters/ Share on other sites More sharing options...
sasa Posted January 30, 2011 Share Posted January 30, 2011 try <?php $test = 'saš-@đć++'; echo preg_replace('/[^\w]/', '', $test); ?> Link to comment https://forums.phpfreaks.com/topic/226113-removing-non-alphabetic-characters/#findComment-1167247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.