SEO is becoming more and more important, and URL’s need to be more visible. Here’s a function for creating a ‘slug’ which I used as an add-on to a site, using the page title.
<?php function slug($str){ $str = strtolower(trim($str)); $str = preg_replace('/[^a-z0-9-]/', '-', $str); $str = preg_replace('/-+/', "-", $str); return $str; } ?> |

Write a Comment
Let me know what you think?