Note that there are some explanatory texts on larger screens.

plurals
  1. POLooping over nested arrays below keys
    primarykey
    data
    text
    <p>Ok, so that title might be a little misleading, but I'm not quite sure what i'm describing, so here goes.</p> <p>I have the following JSON : </p> <pre><code>{ "lastModified": 1368517749000, "name": "Requiem Paradisum", "realm": "Chamber of Aspects", "battlegroup": "Misery", "level": 25, "side": 1, "achievementPoints": 1710, "emblem": { "icon": 126, "iconColor": "ffdfa55a", "border": 3, "borderColor": "ff0f1415", "backgroundColor": "ff232323" }, "news": [ { "type": "itemPurchase", "character": "Osmoses", "timestamp": 1368482100000, "itemId": 91781 }, { "type": "itemLoot", "character": "Greenmean", "timestamp": 1368477900000, "itemId": 87209 }, { "type": "itemLoot", "character": "Greenmean", "timestamp": 1368475800000, "itemId": 86880 }, { "type": "itemPurchase", "character": "Osmoses", "timestamp": 1368475380000, "itemId": 91781 }, { "type": "itemPurchase", "character": "Osmoses", "timestamp": 1368475380000, "itemId": 91779 }, { "type": "itemPurchase", "character": "Osmoses", "timestamp": 1368475320000, "itemId": 91779 }, { "type": "playerAchievement", "character": "Osmoses", "timestamp": 1368470700000, "achievement": { "id": 6193, "title": "Level 90", "points": 10, "description": "Reach level 90.", "rewardItems": [ { "id": 87764, "name": "Serpent's Heart Firework", "icon": "inv_misc_missilelarge_green", "quality": 1, "itemLevel": 1, "tooltipParams": { }, "stats": [ ], "armor": 0 } ], "icon": "achievement_level_90", "criteria": [ ], "accountWide": false, "factionId": 2 } }, </code></pre> <p>Basically i need to loop over everything in "news" and output it. What I can't figure out how to parse it correctly : A : without specifying key numbers and B : when it gets to a key that then contains further keys and further arrays under those keys i'm at a loss. (E.g. the "player achievement" key) I appreciate I'm probably being a bit newbie here and could quite possibly be on page 1 of "php for dummies" but i swear I've googled it to death!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload