A simple way to create a slug:

function slug($s) 
{
  return( strtolower( str_replace(" ", "-", preg_replace("/[^a-z A-Z0-9]/", "", $s) ) ) );
}