json_decode()无法在Web服务器上运行

use*_*456 3 php json magic-quotes-gpc

我有一个PHP脚本,它在我的localhost服务器上运行完美.

当我将所有内容从localhost移动到Web服务器时,我json_decode无法正常工作.

我尝试过json_encode但仍然没有.

这种行为可能有什么问题?

我的代码:

$productsArr = json_encode($_GET['object']);

$_GET['object'] 是经过验证的JSON.

我的最后一个选项可能是,magic_quotes但我不知道我是否可以使用cPanel更改PHP.ini文件,这是我对服务器的唯一访问权限.

我很感激任何想法.

编辑:

这是我的网址的一部分:

Request URL:http://something.com/download.php?object=[{%22code%22:%222F-58S%22},{%22code%22:%22HT-45H%22},{%22code%22:%2244-3%22},{%22code%22:%22898-OPv%22}]&checkbox=
Run Code Online (Sandbox Code Playgroud)

如果这甚至很重要,我正在使用这个标题:

header('Content-Description: File Transfer'); 
header("Content-type: application/ms-word");
header("Content-Disposition: attachment;Filename=$name_of_file.doc");
Run Code Online (Sandbox Code Playgroud)

Mun*_*ndi 7

我必须这样做才能json_decode开展工作.也许有一个更好的计划.

$j = $_POST["json"];
$j = str_replace("\\\\\"", "###dq###", $j);
$j = str_replace("\\", "", $j);
$j = str_replace("###dq###", "\\\"", $j);
Run Code Online (Sandbox Code Playgroud)

或者,简而言之:

$j = stripslashes($j);
Run Code Online (Sandbox Code Playgroud)