Could somebody tell me the name of function that convert spaces to underscores and letters to lowercase for seo friendly uri's?
I know it's very easy function to implement but I want use function for this job if exists in Drupal already.
Regards
I'm not sure what you are trying to accomplish, but you can do a lot with the pathauto module and clean urls.
Unless you are actually creating a custom module that will create your own url, the above mentioned configuration is pretty simple. If you are making a custom module, I have a pretty strong suspicion that making a nice URL would be core functionality.
As LanguaFlash said, if you just need to auto-generate SEO-friendly URLs for your content, use Pathauto: that's what it was made for. Even if you have your own custom module with custom paths, you can hook into Pathauto's API to do all the URL generation for you.
That said, if you really need to throw caution to the wind generate your own clean URLs by yourself, think about creating a dependency on Pathauto and utilizing its two URL cleaning functions—pathauto_cleanstring()
and pathauto_clean_alias()
—which are used by Pathauto to do what you're trying to do.