Last active
August 10, 2022 17:28
-
-
Save alaminfirdows/30a44d79b656d8a7481393ecd8f600c1 to your computer and use it in GitHub Desktop.
Generate UTF-8 Slug PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function createSlug($slug_text) | |
{ | |
return utf8_encode(mb_strtolower(preg_replace('/[ ,.@#$%^&*()_\/=]+/', '-', trim($slug_text)), 'UTF-8')); | |
} | |
// echo createSlug('আমার সোনার বাংলা'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment