This question already has an answer here:
- How do I extract data from JSON with PHP? 5 answers
- How to filter an array by a condition 7 answers
How can I remove the key "src" from this JSON if it is found in the array?
$json = '[{"label":"360","file":"http://aaa","src":"http://aaa"},
{"label":"480","file":"http://bbb","src":"http://bbb"},
{"label":"720","file":"http://ccc","src":"http://ccc"},
{"label":"1080","file":"http://ddd","src":"http://ddd"}]';
The desired end result is this:
$json = '[{"label":"360","file":"http://aaa"},
{"label":"480","file":"http://bbb"},
{"label":"720","file":"http://ccc"},
{"label":"1080","file":"http://ddd"}]';
</div>