is it possible in php to change this array
Array
(
[0] => Array
(
[image_name] => image1
)
[1] => Array
(
[image_name] => image2
)
[2] => Array
(
[image_name] => image3
)
)
to this kind of array . in which their index names are same.
Array
(
[image_name1] => image1
[image_name2] => image2
[image_name3] => image3
)
image_namekey multiple times. What would$array['image_name']return?$arary['image_name']an array of values, but the way you show in your example is not possible.$flattened = array_column($oldArray, 'image_name');as a quick way of flattening that array for PHP >= 5.5; but you must still have unique keys for the index