PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $realname = "This is the string to be made SEO friendly!" $seoname = preg_replace('/\%/',' percentage',$realname); $seoname = preg_replace('/\@/',' at ',$seoname); $seoname = preg_replace('/\&/',' and ',$seoname); $seoname = preg_replace('/\s[\s]+/','-',$seoname); // Strip off multiple spaces $seoname = preg_replace('/[\s\W]+/','-',$seoname); // Strip off spaces and non-alpha-numeric $seoname = preg_replace('/^[\-]+/','',$seoname); // Strip off the starting hyphens $seoname = preg_replace('/[\-]+$/','',$seoname); // // Strip off the ending hyphens $seoname = strtolower($seoname); echo $seoname;
Show:  
Copy Clear