kks_krishna Posted May 19, 2007 Share Posted May 19, 2007 HI, I want replace the given string. The following are my requirements: eg. input string is " Hibernate Interc$%eptors - An Introduction EJB 3.0" the output string should be " Hibernate-Interceptors-An-IntroductionEJB-3-0" special characters should be removed. please help me.dot shd be replaced with "-". Thanks, Krishna Link to comment https://forums.phpfreaks.com/topic/52092-help-in-regular-expression/ Share on other sites More sharing options...
neel_basu Posted May 19, 2007 Share Posted May 19, 2007 echo preg_replace('/([^\w])/', '', $str); Here $str is the Original String. Link to comment https://forums.phpfreaks.com/topic/52092-help-in-regular-expression/#findComment-257107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.