Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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编码到base64中,然后对其进行解码_Php_Url_Get - Fatal编程技术网

Php 将url编码到base64中,然后对其进行解码

Php 将url编码到base64中,然后对其进行解码,php,url,get,Php,Url,Get,我使用base64对一个具有GET参数的url进行编码,然后对其进行解码以获取相同的url。我收到的字符串是 task_type=all&keyword=asdfsd&location=Vasant Kunj&category=17&subcategory=19&price[]=&price[]=100&price[]=300&price[]=500&price[]=above&educations[]=&e

我使用base64对一个具有GET参数的url进行编码,然后对其进行解码以获取相同的url。我收到的字符串是

task_type=all&keyword=asdfsd&location=Vasant Kunj&category=17&subcategory=19&price[]=&price[]=100&price[]=300&price[]=500&price[]=above&educations[]=&educations[]=22&educations[]=29&industry[]=&industry[]=1&industry[]=7&experience=6&freshness=1
现在,我如何获取原始的$\u get数组,以便使用它。或者任何其他获取所有参数的方法,以便我可以使用它们。或任何其他更好的编码和解码方式,以便用户看不到原始url


谢谢你的帮助。Thanx提前。

当您使用base64编码包含
GET
参数的url时,您将无法获得准确的
GET
参数。但在解码后,您将获得前面提到的
查询字符串
,因此在本例中,您可以使用
parse_str()
,请参阅

例如:

$queryString = "task_type=all&keyword=asdfsd&location=Vasant Kunj&category=17&subcategory=19&price[]=&price[]=100&price[]=300&price[]=500&price[]=above&educations[]=&educations[]=22&educations[]=29&industry[]=&industry[]=1&industry[]=7&experience=6&freshness=1";
parse_str($queryString, $getParamsArray);
var_dump($getParamsArray);

我想这就是你要找的…

Thanx bro。成功了。很抱歉,我的声誉不足以提高投票率。@Nick我很高兴这起到了作用,如果你不能提高投票率,不用担心,只要将其标记为已接受,这样其他人就会从中受益:)