I currently have an Array:
[1] => Array
(
[0] => 100011
[1] => 1
)
[2] => Array
(
[0] => 100013
[1] => 1
)
[3] => Array
(
[0] => 100022
[1] => 1
)
[4] => Array
(
[0] => 100025
[1] => 1
I want to take the first child item (meaning [0]) of each array (1,2,3,4,etc) and put it into a new array. I know I need to loop through and assign the value to new array. Just not sure how to do it.
End result would be:
$final (name of new array) has values 100013,100022,100025,etc.
My real end result:
I need it kept in the same order, because I am then going to use array array_combine ( array $keys , array $values ) to create 100013 as the key and 1 as the value, 100022 as the key, 1 as the value, 100025 as the key, 1 as the value.
If you know a quicker way to accomplish, it is appreciated.
Thanks.
array_column($arr, 0)