3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = ' { "status": "OK", "response": { "1": { "name": "Personal Information", "fields": { "1": { "name": "About Me", "value": "" }, "4": { "name": "Discord name", "value": "TestAccount#1012" } } } } } '; $j = json_decode($json, TRUE); foreach($j['response'] as $response) { foreach($response['fields'] as $fields){ if($fields['name'] == 'Discord name') { echo $fields['value']; } } }
based on m0Vno
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
TestAccount#1012