I have an indexed array like this
and I need to change the index to a key so it looks like this:
I tried array_combine and array_column, but I do not think my syntax was correct. Thank you.
Code:
Array (
[0] => Array (
[0] => 2021-07-06_18-00.jpg
[1] => Tuesday Jul 06, 2021, 6:00 pm )
[1] => Array (
[0] => 2021-07-05_12-00.jpg
[1] => Monday Jul 05, 2021, 12:00 pm )
[2] => Array (
[0] => 2021-07-04_12-00.jpg
[1] => Sunday Jul 04, 2021, 12:00 pm )
[3] => Array (
[0] => 2021-07-03_12-00.jpg
[1] => Saturday Jul 03, 2021, 12:00 pm ) )
and I need to change the index to a key so it looks like this:
Code:
array(
array(
"imgname" => "2021-07-06_18-00.jpg",
"imgdate" => "Tuesday Jul 06, 2021, 6:00 pm",
),
array(
"imgname" => "2021-07-05_12-00.jpg",
"imgdate" => "Monday Jul 05, 2021, 12:00 pm",
),
array(
"name" => "2021-07-04_12-00.jpg",
"email" => "Sunday Jul 04, 2021, 12:00 pm",
)
I tried array_combine and array_column, but I do not think my syntax was correct. Thank you.