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 "-".
$text = preg_replace(array('/[^\w-]+/', '/-{2,}/'), array('', '-'), str_replace('.', '-', $text)); PHP: This would allow only alphanumeric characters, underscores and dashes. (untested)