How can I convert a node title to a lowercase string with hyphens? I need to convert the title of a node, for example, from this


  John Doe


to


  john-doe


Is there Drupal function for it? (Easier to use than using preg_preplace etc.)
If you're just looking for a way to convert the title into a URL friendly machine name, then the following regex will do what you need:

$machine_name = preg_replace('@[^a-z0-9-]+@','-', strtolower($title));