2013-02-08 32 views
-1

我得到JSON響應形式iPhone應用程序如下JSON解碼

{"json":{"age":"23","userid":"1","weight":"55","fullname":"goutham"}}; 

任何一個可以告訴我如何將其解碼..

+0

http://php.net/manual/en/function.json-decode.php – koopajah

回答

1

使用PHP的功能:json_decode

<?php 
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; 

var_dump(json_decode($json)); 
var_dump(json_decode($json, true)); 

?> 

來源:從上述參考手冊

0

使用json_decode實施例

$array = json_decode($string, true); 
/// please note the second parameter 'true' here, it is needed if you want your o/p as array or you will get it as object 

print_r($array); 

裁判:http://php.net/json_decode

0

,我認爲我們在這裏失蹤的問題,從u所提供的JSON字符串看,你可以清楚地看到你有它的屬性的對象。

看一看JSON的規格http://www.json.org/

{JSON:{年齡:23​​等

我希望通過做json_decode它ü將能夠獲取對象的屬性通過簡單地說, :$ json-> age

希望這會有所幫助