How can I convert a node title to a lowercase string with hyphens?
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));