Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在通过php打开url时使用德语umlauts_Php_String_Http_Character Encoding_Diacritics - Fatal编程技术网

在通过php打开url时使用德语umlauts

在通过php打开url时使用德语umlauts,php,string,http,character-encoding,diacritics,Php,String,Http,Character Encoding,Diacritics,我已经编写了一个php代码,在其中我希望使用字符串($password here)访问特定的url,该字符串可以包含像ä,ö,ü这样的德语umlauts。 代码在使用普通字符时运行良好,但当我在字符串中使用这些字符时,它无法正确访问url。 为了澄清,如果我通过浏览器直接访问url以及umlaut字符串,它将给出预期的结果。 以下是我的代码片段: $username='abcd'; $password='abcdä'; $minecraftSocket=fopen(“http://login.m

我已经编写了一个php代码,在其中我希望使用字符串($password here)访问特定的url,该字符串可以包含像ä,ö,ü这样的德语umlauts。 代码在使用普通字符时运行良好,但当我在字符串中使用这些字符时,它无法正确访问url。 为了澄清,如果我通过浏览器直接访问url以及umlaut字符串,它将给出预期的结果。 以下是我的代码片段:

$username='abcd';
$password='abcdä';
$minecraftSocket=fopen(“http://login.minecraft.net/user=$username&password=$password&version=13,“rb”)


如何将$password传递给此url,以便得到预期的结果?

这些值可以是url编码的(请参阅),但这里的大问题是在非安全连接上通过url查询字符串发送密码。非常感谢@Pudge601。现在可以使用了。我知道这种非安全连接,但我别无选择,因为这是检查minecraft.net帐户的唯一方法,我需要将它嵌入我的脚本中。谢谢你。