- var_dump: documentation ( source)
- implode: documentation ( source)
- array_walk: documentation ( source)
<?php
$array = [
(object) ['id' => 1, 'name' => 'hovno'],
(object) ['id' => 2, 'name' => 'piča'],
];
$test = array_walk($array, function($item) { return $item->id; });
var_dump($test);
echo implode(',', $test);