CodeIgniter Forums
URL friendly words - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: URL friendly words (/showthread.php?tid=2275)



URL friendly words - El Forum - 07-26-2007

[eluser]omed habib[/eluser]
Is there a built in function that can take a word and create a URL friendly string that can be passed in the URL?

For example:

A starter's assesment and/or functionality.

can be converted to:

astartsassessmentandorfunctionality



Thanks!


URL friendly words - El Forum - 07-26-2007

[eluser]Phil Sturgeon[/eluser]
urlencode() ?


URL friendly words - El Forum - 07-26-2007

[eluser]座頭市[/eluser]
The Inflector helper has a few functions for string conversion like that.


URL friendly words - El Forum - 07-27-2007

[eluser]frenzal[/eluser]
url_title()

it defaults to using dashes (-) as seperator (which is better for SEO) but if you want your words stuck together i think you can do this url_title($string, "") the second parameter should be the seperator char