2015-12-02 77 views
-1

我在file_get_contents("php://input")上使用json_decode,但每次都得到空值。
我輸出file_get_contents("php://input")並得到這種格式的輸出a=1&b=2
如何將其轉換爲數組?php json_decode每次都返回null

+0

使用'parse_str'。 – Flosculus

+0

向我們展示發送輸入的表單或腳本!這不是json,而是從腳本/表單發佈的兩個變量a = 1和b = 2 –

+1

那麼,**不是JSON。**只需使用'$ _POST',您的數據應該已經存在。 – deceze

回答