Al jazary icon and logo Al jazary

Php create seo friendly urls auto generated from title - Al jazary

published 13 Jul 2016

Php create seo friendly urls auto generated from title

we assumed you have understand about seo url, so this method we will use one of awesome php function call regex, this function will sort of character and modified it as we ruled. of course php regex more complicated but only for this tips we will use a simple way to generate our seo friendly urls directly from blog article posting. let's have a look first to our current method to submit data into database.

we want to submit data to database for example mysql, then we using html form to POST it to server. parameter that we use as default is title,description,category,content,image.

generated url automatic from article title


  //generate urls from title.
  //1st. go to lowercase!
  //to avoid duplicate url so
  //we add random number (optional)

  //2nd replace all except string(a-z),integer(0-9) and spaces.
  $url=preg_replace('/[^da-z0-9 ]/i', '',$url);
  //3rd we change all spaces into stripe (-)
  $url=str_replace(" ","-",$url);

now we have our seo friendly url that generate it self from blog post title, all you have to do is submit it using PHP SQL function into database and done.

we hope you enjoying this tips, have any question or suggestion hot a comment below.

regexseourl updated 18 Jul 2016

2 total comments

  • 4 month 2 days ago zSt1Eqyn6B said: zSt1Eqyn6B Reply

  • 1 month 1 week ago 1PI6X4W62 said: 1PI6X4W62 Reply

Add Comment








Top articles