Here's a section my multidimensional array:
Array (
[0] => Array ( [0] => Height [1] => 40 )
[1] => Array ( [0] => Weight [1] => 15 )
[2] => Array ( [0] => Ctr_Percent [1] => 15 )
)
What would the syntax be for just printing height
, weight
, and ctr_percent
? I don't mean echoing it like:
echo $array[0][0];
echo $array[1][0];
Is there a way to iterate through the entire multidimensional array and echo out the first value of each child array?
Use array_column:
$result = array_column($array, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With