I want to convert an array of this style:
Array ( [0] => Array ( [post_id] => 20752 ) [1] => Array ( [post_id] => 20753 ) )
into the string:
20752, 20753
How can I do this?
I want to convert an array of this style:
Array ( [0] => Array ( [post_id] => 20752 ) [1] => Array ( [post_id] => 20753 ) )
into the string:
20752, 20753
How can I do this?
You can use PHP array_column
function with combination of implode
:
implode(', ', array_column($data, 'post_id'));