3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<_JSON { "aaa": [ { "title": "xx", "description": "6" }, { "title": "tt", "description": "b" } ] } _JSON; $data = json_decode($json); $title = trim('xx'); $data->aaa = array_values(array_filter($data->aaa, function($item) use ($title) { return (bool) strcmp($item->title, $title); })); echo json_encode($data, JSON_PRETTY_PRINT);

preferences:
124.73 ms | 409 KiB | 5 Q