如何解码ü;在PHP中添加到%FC

如何解码ü;在PHP中添加到%FC,php,utf-8,decode,encode,Php,Utf 8,Decode,Encode,我花了很长时间试图解码aüto%FC,但没有任何帮助。我希望有人能帮助我 以下是包含以下代码的示例url: http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-

我花了很长时间试图解码aüto%FC,但没有任何帮助。我希望有人能帮助我

以下是包含以下代码的示例url:

http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-Allee+51&choose=true&sfn=yes&image=Finden&skw=yes&context=1&book=96&ci=M%FCnchen&noList=false
致意


Gimo

在这里,您可以按如下方式对URL进行编码:

<?php
// Here to encode whole URL
$url = "http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-Allee+51&choose=true&sfn=yes&image=Finden&skw=yes&context=1&book=96&ci=München&noList=false";
$encoded = urlencode($url);
echo "Encoded URL : ".$encoded."</br></br></br>";
$decoded = urldecode($encoded);
echo "Decoded URL : ".$decoded."</br></br></br>";

//Or If you want to just encode the certain required part so here you can do like this way
$url = "http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-Allee+51&choose=true&sfn=yes&image=Finden&skw=yes&context=1&book=96&ci=M".urlencode("ü")."nchen&noList=false";
echo "URL With Required Encoded Part : ".$url;
?>

在这里,您可以按如下方式对URL进行编码:

<?php
// Here to encode whole URL
$url = "http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-Allee+51&choose=true&sfn=yes&image=Finden&skw=yes&context=1&book=96&ci=München&noList=false";
$encoded = urlencode($url);
echo "Encoded URL : ".$encoded."</br></br></br>";
$decoded = urldecode($encoded);
echo "Decoded URL : ".$decoded."</br></br></br>";

//Or If you want to just encode the certain required part so here you can do like this way
$url = "http://www2.dasoertliche.de/?form_name=search_nat_ext&vert_ok=1&zvo_ok=1&kgs=09162000&rgid=&buab=&zbuab=&buc=2247&sst=yes&page=1&action=43&st=Drygalski-Allee+51&choose=true&sfn=yes&image=Finden&skw=yes&context=1&book=96&ci=M".urlencode("ü")."nchen&noList=false";
echo "URL With Required Encoded Part : ".$url;
?>

你真的想用url做什么???你的意思是想从
%FC
解码
u
?你不能,至少在utf-8中是这样。在utf-8中,
u
字符可以用两个字节(
%C3%BC
)而不是一个字节进行url编码。你只是在某个地方与编码不一致。你真的想用url做什么???你的意思是你想从
%FC
解码
u
?你不能,至少在utf-8中是这样。在utf-8中,
u
字符可以用两个字节(
%C3%BC
)而不是一个字节进行url编码。你只是在某个地方对编码不连贯。