2008/08/14 6:30:03
32
1
15 www.aurore.net [
この元コンテンツへ ]
$input = '{ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ], "float": 1.2345 }'; $val = json_decode($input); echo $val->abc."\n"; Would produce: 12 As of version 1.0.5, json_decode takes an optional parameter, assoc (boolean), that returns an associative array instead of an object. A PHP object correlates to a JavaScript object (associative array, i.e., key => value pairs), so the above would be referenced in JavaScript like so: var obj = ...; /* retrieve JSON and eva...
[
← 前の画面 ]
【 PR 】 ご存じですか? Googleの便利なサービス [
ニコニコ風 ] [
関連記事 ] [
Feeling Lucky ]