I want to pass any text as a get parameter to a php script. For know I just append the text this way:
action.php?text=Hello+my+name+is+bob
This url is posed by javascript and I do a ajax request with this url.
In action.php I do
$encoded = array_map('rawurlencode', $_GET);
But this does not work for special chars like ÖÄüä
.
Any idea how to solve this?
I want to pass any text as a get parameter to a php script. For know I just append the text this way:
action.php?text=Hello+my+name+is+bob
This url is posed by javascript and I do a ajax request with this url.
In action.php I do
$encoded = array_map('rawurlencode', $_GET);
But this does not work for special chars like ÖÄüä
.
Any idea how to solve this?
Share Improve this question edited Mar 6, 2011 at 18:29 DarkLeafyGreen asked Mar 6, 2011 at 18:11 DarkLeafyGreenDarkLeafyGreen 70.5k136 gold badges391 silver badges616 bronze badges2 Answers
Reset to default 3url_encode(string) will return the given string with special characters converted into %XX format.
https://www.php/manual/en/function.urlencode.php
I know you can send special characters fine without encoding through $_POST, which is another alternative
try with url_encode().........