Szymon Toda
Szymon Toda

Reputation: 4516

PHP transform URL but no special characters

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

echo "$url<br> $urlLower ";

Outputs:

test%c4%99
test%C4%99

How to output

test%C4%99
test%C4%99

Upvotes: 3

Views: 155

Answers (1)

Nicklas Nygren
Nicklas Nygren

Reputation: 2605

I think you want to take a look at urlencode:

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

Which will give you:

$urlLower = 'test%C4%99'

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

Upvotes: 1

Related Questions