I have an array from the same db but different columns but i need both values in combine state
[0] => Array
(
[Student Name] => student_name
)
[1] => Array
(
[Student ID] => student_id
)
[2] => Array
(
[Marks 1] => maths
)
[3] => Array
(
[Mark 2] => english
)
But I need values in format :
[0] => Array(
[Student Name] => student_name
[Student ID] => student_id
[Marks 1] => maths
[Mark 2] => english
)
You can do it with a foreach
.
Something like
$sortedArray = array();
foreach($completeArray as $singleArray) {
$sortedArray[] = $singleArray[0];
}
I don't tested this, please don't blame me. It's just a sample.
$completeArray
is your result from your db.
I hope this will do the thing you want.