·
1 min read
·
2 comments
How to Slugify a String in PHP
Here is a snippet for generating a URL friendly slug in PHP function slugify($string){ return strtolower(trim(pregreplace('/[^A-Za-z0-9-]+/', '-', $string), '-')); } And you can use it in your code...