• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert input to alias

Im writing a blog application as my first PHP app with CI.
I have a question.
When the administrator posts a new entry with title, body. I want to convert the title input to alias and store it in my database in order to make the URL nicer with SEO.
For example: My First Entry -> my-first-entry or something like that.

Please help me.

I am telling you what to do, and you implement it Smile.

clean your URL of ", ', 's and other buggy chars
break your url into pieces depending on  ( ) - space, explode()
foreach on your array and make a new string, by adding "-".

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.