当我添加带有土耳其字符的零售商时,URL 中会省略这些土耳其字符。
功能是;
function friendlyURL($string, $down = 0)
{
$string = preg_replace("`\[.*\]`U","",$string);
$string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$string);
$string = htmlentities($string, ENT_COMPAT, 'utf-8');
$string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string );
$string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $string);
if ($down == 1)
{
$string = str_replace('-','_',$string);
return strtolower(trim($string, '_'));
}
else
{
return strtolower(trim($string, '-'));
}
}
名为“deneme mağazası”的零售商的网址为“domain.com/deneme-ma-azas-site”
如何转换土耳其语字符?