<input type="hidden" name="gallery[0]" value="gallery-image-1500382700392.jpeg">
<input type="hidden" name="gallery[1]" value="gallery-image-1500382700392.jpeg">
<input type="hidden" name="gallery[2]" value="gallery-image-1500382700392.jpeg">
This is the form elements.In my admin panel i have the facility to delete images in the art gallery.If I am deleting name="gallery[2]" element, data saved to database is
["gallery-image-1500382700392.jpeg", "gallery-image-1500382700392.jpeg"]
and the format is json array
But if Iam deleting name="gallery[1]" element, data saved to database is of json object format.
{"0": "gallery-image-1500295044382.jpeg","2": "gallery-image-1500295044382.jpeg"}
I think this is because array indexing is not there [0,1] so treated as just key-value pair
I there any way to re-order this indexing?