我正在嘗試使用json字符串來填充我的鈦應用程序。但通常我沒有信息的JSON字符串作爲下面的例子面前:鈦,PHP和json編碼
{
"id": 1,
"jsonrpc": "2.0",
"total": 5,
"result": [
{
"id": 1,
"guid": "1d4aa3b2-c059-4fa7-a751-9bca735e4ebb",
"picture": "http://skounis.s3.amazonaws.com/mobile-apps/barebone/photo-1.jpg",
"title": "Wisi consequat sit zzril.",
"body": "Ut vulputate te dolor ipsum nonummy, dolore enim accumsan veniam duis, nibh veniam at nulla. Adipiscing, dolore dolor lobortis et qui, consequat ea tation iusto qui, tation velit minim. Delenit elit, feugait nibh illum diam vulputate, feugiat erat et velit veniam, tation ea. Consequat magna et, iriure delenit zzril vel ea, eum amet ut autem consequat, tincidunt. Aliquam adipiscing vero dolore, magna ut vel et veniam, iriure odio ullamcorper erat vulputate, facilisi dolore hendrerit in accumsan, accumsan illum iriure quis nibh, nisl vulputate nostrud enim. Commodo, lorem luptatum erat ut elit, blandit dolor eu adipiscing ipsum, dolor.",
"tags": ["feugait", "vel", "nulla"]
}
]
}
所以我的問題是我怎麼寫一個數組,讓薩姆斯輸出這一點,但在那裏我可以編輯信息首先像total,id和jsonrpc。
謝謝。
「但通常我沒有在JSON字符串的前信息......」「不過,我可以編輯至上像......」呵呵信息什麼? – PeeHaa
看看[json_encode](http://www.php.net/manual/en/function.json-encode.php)和[json_decode](http://php.net/json_decode) – bansi