我尝试了很长时间来解码ü到%FC但没有任何帮助。我希望有人可以帮助我。
以下是使用此代码的示例网址:
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
祝你好运
伊穆
答案 0 :(得分:0)
此处您可以这样对您的网址进行编码:
<?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;
?>
输出:
Encoded URL : http%3A%2F%2Fwww2.dasoertliche.de%2F%3Fform_name%3Dsearch_nat_ext%26vert_ok%3D1%26zvo_ok%3D1%26kgs%3D09162000%26rgid%3D%26buab%3D%26zbuab%3D%26buc%3D2247%26sst%3Dyes%26page%3D1%26action%3D43%26st%3DDrygalski-Allee%2B51%26choose%3Dtrue%26sfn%3Dyes%26image%3DFinden%26skw%3Dyes%26context%3D1%26book%3D96%26ci%3DM%C3%BCnchen%26noList%3Dfalse
Decoded 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
URL With Required Encoded Part : 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%C3%BCnchen&noList=false