Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To Parse YAML you can use various available PHP parsers. i parsed your YAML by using <a href="http://yaml-online-parser.appspot.com/" rel="nofollow">Online YAML Parser</a> and output the string in JSON. At The end required array values can be accessed by decoding the JSON.</p> <p>* please note i cut the string short just for example purpose *</p> <pre><code>$arr='{ "Residences": { "WorkArea": {"BlackList": {"Type": "BLACKLIST", "ItemList": []}, "EnterMessage": "Welcome %player to %residence, owned by %owner.", "Areas": { "main": { "Y1": 217, "X1": -6301, "X2": -6306, "Y2": 205, "Z1": 3001, "Z2": 2981 } }, "Permissions": {"Owner": "cal9897","World": "VivaWorld"} }, "caylyn55": { "BlackList": { "Type": "BLACKLIST", "ItemList": [] }, "EnterMessage": "Welcome %player to %residence, owned by %owner.", "StoredMoney": 0, "IgnoreList": { "Type": "IGNORELIST", "ItemList": [] }, "LeaveMessage": "Now leaving %residence.", "Subzones": {}, "Areas": { "main": { "Y1": 67, "X1": 1220, "X2": 1210, "Y2": 64, "Z1": 369, "Z2": 360 } }, "Permissions": { "Owner": "caylyn55", "PlayerFlags": {}, "GroupFlags": {}, "World": "VivaWorld" } } }, "Version": 1, "Seed": 1337068141 }'; </code></pre> <p>Decode JSON </p> <pre><code>$a= json_decode($arr,true); </code></pre> <p>First Area Value get through </p> <pre><code>$a['Residences']['WorkArea']['Areas']['main']['Y1']; </code></pre> <p>and Second Area value</p> <pre><code>$a['Residences']['caylyn55']['Areas']['main']['Y1']; </code></pre> <p>if ['WorkArea'] AND ['caylyn55'] dynamic you can use this code</p> <pre><code>$b=array_values($a); foreach($b as $values) { if(is_array($values)) { foreach(array_keys($values) as $c){ echo $a['Residences'][$c]['Areas']['main']['Y1']; } } } </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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