PHP _REQUEST[variable]在两个服务器中不同


PHP _REQUEST[variable] different in two servers

我对后期数据编码有问题。我将(从我的应用程序)数据(使用UTF8)发送到php-scrypt和相同的数据:1) 在本地服务器中看起来像:

_REQUEST["data"]    {"type": "FeatureCollection"

2) 远程(商业)服务器看起来像

_REQUEST["data"]    %7B%22type%22:%20%22FeatureCollection%22

PHP或函数中的设置参数是从十六进制形式引入字符吗?

使用URL解码。

$data = urldecode($_REQUEST["data"]);

您可以将UTF-8解码功能与urldecode、一起使用

$data = utf8_decode(urldecode($_REQUEST["data"]));