I have an array that I got from my $_POST data with this values
Array (
[unit] =>
[items] => Array (
[1] => Array (
[category] => 1
[items] => 5
[qty] => 1
[jan] => 1
[feb] =>
[mar] =>
[apr] =>
[may] =>
[jun] =>
[jul] =>
[aug] =>
[sep] =>
[oct] =>
[nov] =>
[dec] =>
)
[2] => Array (
[category] => 1
[items] => 20
[qty] => 1
[jan] => 1
[feb] =>
[mar] =>
[apr] =>
[may] =>
[jun] =>
[jul] =>
[aug] =>
[sep] =>
[oct] =>
[nov] =>
[dec] =>
)
[3] => Array (
[category] => 1
[items] => 27
[qty] => 1
[jan] => 1
[feb] =>
[mar] =>
[apr] =>
[may] =>
[jun] =>
[jul] =>
[aug] =>
[sep] =>
[oct] =>
[nov] =>
[dec] =>
)
)
[action] =>
)
I'm trying to get each array and pass it to my model for database insertion. For example get the array of [items] where [1] points.
I have tried using
$array_col = array_column($_POST, 'items');
print_r($array_col);
but it returns Array() which is empty.
Thank you for the answers.