Sorry guys, I am new in programmer and I am stuck in this code, I want to implode this array and get result like this: Action, Adventure, Comedy, Science Fiction
$input = Array (
[0] => stdClass Object ( [id] => 28 [name] => Action ) [1] => stdClass Object ( [id] => 12 [name] => Adventure ) [2] => stdClass Object ( [id] => 35 [name] => Comedy ) [3] => stdClass Object ( [id] => 878 [name] => Science Fiction )
)
I am trying do like this and always getting error messages:
echo implode(', ', array_map(function ($entry) {
return $entry['name'];
}, $input));
or
echo implode(', ', array_column($input, 'name'));
Thanks for help.