3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"language":"en","education":[{"unit":"e1","language":"en"}],"membership":[{"uei":"21","Uifed":"failed"}]}'; $arrayData = json_decode($json, true); foreach ($arrayData['membership'] as &$membership) { if ('failed' === $membership['Uifed']) { $membership['Uifed'] = 'success'; } } print_r($arrayData);

preferences:
96.46 ms | 405 KiB | 5 Q