i'm using tinymce editor. It's working normal but when im using slug, it's not working correctly For example; when i'm writing "Türkçe Ürün", i see the result "t,uuml,rk,ccedil,e,uuml,r,uuml,n" like this.
// Slugify a string
function slugify($text)
{
$text = str_replace('ü','u',$text);
$text = str_replace('Ü','U',$text);
$text = str_replace('ğ','g',$text);
$text = str_replace('Ğ','G',$text);
$text = str_replace('ş','s',$text);
$text = str_replace('Ş','S',$text);
$text = str_replace('ç','c',$text);
$text = str_replace('Ç','C',$text);
$text = str_replace('ö','o',$text);
$text = str_replace('Ö','O',$text);
$text = str_replace('ı','i',$text);
$text = str_replace('İ','I',$text);
// Strip html tags
$text=strip_tags($text);
// Replace non letter or digits by -
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
// Transliterate
setlocale(LC_ALL, 'en_US.utf8');
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
// Remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
// Trim
$text = trim($text, '-');
// Remove duplicate -
$text = preg_replace('~-+~', ',', $text);
// Lowercase
$text = strtolower($text);
// Check if it is empty
if (empty($text)) { return 'n-a'; }
// Return result
return $text;
}