arrays - Concatenate two consecutive foreach iterations in PHP? -
i have $result variable. has following structure: i trying array structured this: masculine => 1 , feminine => 2 . i stuck here: foreach ($result $row) { foreach ($row $column => $value) { echo $column . ' order ' . $value . '<br/>'; } } the output of attempt is: i tried using next() function , apply $row variabile, each iteration got 1(2) => false . i'd appreciate help! you can use php builtin function array_column job. array_column — return values single column in input array (php 5 >= 5.5.0, php 7) syntax - array array_column ( array $input , mixed $column_key [, mixed $index_key = null ] ) and script - <?php $result = array( array( 'gender_value' => 'masculine', 'gender_preffered_order' => 1 ), array( 'gender_value' => 'feminine', 'gender_preffered_order' => 2 ...