Monday, October 22, 2012

PHP Function to create slug from string

Here is simple Function to create slug from string.



function getSlug($title)
             {
                        $slug = preg_replace("/[^a-zA-Z0-9 ]/", "", $title);
                           $slug = str_replace(" ", "-", $slug);
                        $slug=strtolower($slug);
                        return($slug); 
  }

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...