This tutorial explains how to create SEO friendly URL using PHP. Friendly URLs improves your site's search engines ranking. To make a SEO friendly URL a string must be sanitized for certain things like...
URL should be in lower case
All spaces should be replaced with a dash or hyphen (-)
URL must only contains letters and numbers.
NO HTML is allowed.
I found a very quick and clean way to do this.
// replace all non letters or digits with -
$string = preg_replace('/W+/', '-', $string);
// trim and lowercase
$string = strtolower(trim($string, '-'));
$string="making String SEO Friendly with PHP is easy, isnt?";