Autor | Zpráva | ||
---|---|---|---|
objGET Profil * |
#1 · Zasláno: 13. 9. 2014, 14:32:43
Dobry den,
mam tento json: { "appnews": { "appid": 440, "newsitems": [ { "gid": "521612247017608543", "title": "Team Fortress 2 Update Released", "url": "http://store.steampowered.com/news/externalpost/tf2_blog/521612247017608543", "is_external_url": true, "author": "", "contents": "An update to Team Fortress 2 has been released. The update will be applied automatically when you restart Team Fortress 2. The major changes include: * Fixed a problem that was preventing clients from uploading items to the Steam Workshop ", "feedlabel": "TF2 Blog", "date": 1410386700, "feedname": "tf2_blog" }, { "gid": "521612247017428766", "title": "Team Fortress 2 Update Released", "url": "http://store.steampowered.com/news/14354/", "is_external_url": false, "author": "Valve", "contents": "An update to Team Fortress 2 has been released. The update will be applied automatically when you restart Team Fortress 2. The major changes include: * Fixed a problem that was preventing clients from uploading items to the Steam Workshop; ", "feedlabel": "Product Update", "date": 1410386700, "feedname": "steam_updates" }, { "gid": "521612247015463937", "title": "Team Fortress 2 Update Released", "url": "http://store.steampowered.com/news/externalpost/tf2_blog/521612247015463937", "is_external_url": true, "author": "", "contents": "An update to Team Fortress 2 has been released. The update will be applied automatically when you restart Team Fortress 2. The major changes include: * Added taunts to the items that can be uploaded to the Steam Workshop ;* Added new \"Taunt\" and \"Halloween\" tags to the Steam Workshop; * Previous ent...", "feedlabel": "TF2 Blog", "date": 1410382620, "feedname": "tf2_blog" } ] } } A v PHP $obj = json_decode($json); print $obj->{'gid'}; Napriklad chci vytahnout "hodnotu" u "gid" a napise mi to toto: Notice: Undefined property: stdClass::$gid in *\json.php on line |
||
Fisir Profil |
#2 · Zasláno: 13. 9. 2014, 14:35:49
Reaguji na objGETa:
json_decode() vrací pole.
|
||
abc Profil |
#3 · Zasláno: 13. 9. 2014, 14:41:13 · Upravil/a: abc
Najdeš to v
$obj->appnews->newsitems[0]->gid; Fisir: > Reaguji na objGETa: > json_decode() vrací pole. Pouze pokud je druhý parametr TRUE jinak vrací objekt
|
||
objGET Profil * |
#4 · Zasláno: 13. 9. 2014, 15:08:22
Diky moc.
|
||
Časová prodleva: 10 let
|
0