Monday, May 13, 2013

SEO Friendly URL function in PHP

5/13/2013

This post explains you, how to Convert simple url to SEO friendly URL using a simple PHP function. Pass your url to SEOURL funtion which is convert your url as a seo friendly url
<?php
/* 
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/


function SEOURL($_string)
{

  return strtolower(str_replace(array('  ', ' '), '-', preg_replace('/[^a-zA-Z0-9 s]/', '', trim($_string))));

}


// usage

SEOURL($simple_url);


?>

helpful? Share this

The Editorial Team of 4everTutorials consists of a group of PHP Professionals.

0 comments:

 

© 2014 4everTutorials. All rights resevered.

Back To Top