Answer the question
In order to leave comments, you need to log in
How to make the first value in a row a key in a two-dimensional array?
There is such an array:
$rows2 = [
['id'=>'a1','update_at' => dddd,'create_at' => cccc],
['id'=>'a2','update_at' => dddd, 'create_at' => cccc]
];
How to make it like this:
$rows2 = [
['a1' => ['update_at' => dddd,'create_at' => cccc]],
['a2' => ['update_at' => dddd,'create_at' = > cccc]],
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question