PHP 转换 URL,但没有特殊字符


PHP transform URL but no special characters

$url= "testę";
$urlLower = strtolower($url);
echo "$url<br> $urlLower ";

输出:

test%c4%99
test%C4%99

如何输出

test%C4%99
test%C4%99
我想

你想看看urlencode:

$url = 'testę';
$urlLower = urlencode($url);

这将为您提供:

$urlLower = 'test%C4%99'

http://php.net/manual/en/function.urlencode.php