0

当我添加带有土耳其字符的零售商时,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”

如何转换土耳其语字符?

4

1 回答 1

0

根据 RFC 1738,这是不可能的。

这是关于 http://www.blooberry.com/indexdot/html/topics/urlencoding.htm的参考

于 2013-05-26T20:29:35.333 回答