PHP转换URL但没有特殊字符

时间:2013-08-04 07:53:48

标签: php url-rewriting

$url= "testę";
$urlLower = strtolower($url);

echo "$url<br> $urlLower ";

输出:

test%c4%99
test%C4%99

如何输出

test%C4%99
test%C4%99

1 个答案:

答案 0 :(得分:1)

我想你想看看urlencode:

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

哪个会给你:

$urlLower = 'test%C4%99'

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