Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function create_slug($text)
- {
- $text = preg_replace('~[^\\pL\d]+~u', '-', $text);
- $text = trim($text, '-');
- $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
- $text = strtolower($text);
- $text = preg_replace('~[^-\w]+~', '', $text);
- if (empty($text))
- {
- return 'n-a';
- }
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement