-1
我在file_get_contents("php://input")
上使用json_decode
,但每次都得到空值。
我输出file_get_contents("php://input")
并得到这种格式的输出a=1&b=2
。
如何将其转换为数组?php json_decode每次都返回null
我在file_get_contents("php://input")
上使用json_decode
,但每次都得到空值。
我输出file_get_contents("php://input")
并得到这种格式的输出a=1&b=2
。
如何将其转换为数组?php json_decode每次都返回null
为什么json_decode
?!使用parse_str
使用'parse_str'。 – Flosculus
向我们展示发送输入的表单或脚本!这不是json,而是从脚本/表单发布的两个变量a = 1和b = 2 –
那么,**不是JSON。**只需使用'$ _POST',您的数据应该已经存在。 – deceze