- dirname: documentation ( source)
- var_export: documentation ( source)
- array_walk: documentation ( source)
<?php
$list = [
(object)['name' => 'Something', 'link' => 'high/over/there'],
(object)['name' => 'Items', 'link' => 'this/is/foo/bar'],
];
array_walk($list, function ($v) {
if ($v->name == 'Items') $v->link = dirname($v->link);
});
var_export($list);