我鏈接到我的網頁是這樣如何獲得發送爲JSON
http://mysite.php?json={"some_key":"some_val"}
$json=$_GET ['json'];
$obj = json_decode($json);
#this line print the whole input
echo $json."</br>";
#but this does not print anythig
echo $obj->{'some_key'}."</br>";
我新的PHP和我在閱讀輸入卡住... :(
**編輯
我的觀點是採取some_val到變量,所以我可以根據價值作出決定......
對我來說,將它放入網址是最簡單的方法,但是如果我必須實現POST方法。
我需要應該是這樣的
$variable=(read the value for the key "some_key")
你爲什麼要在url中發送json? – Legionar
您應該發送$ _POST –
JSON我需要一些輸入到我的PHP之前,它的星星他的工作..., – Lukap