Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Array changes after doing unset in php

I am confused seeing this behaviour.

I have a php array like this

$a=[
  "315.316",
  "315.318",
  "315.322",
  "315.321",
  "315.326",
  "315.328",
]

Now when I do first unset($a[0]) the structure changes to this

{
  1: "315.318",
  2: "315.322",
  3: "315.321",
  4: "315.326",
  5: "315.328",
}

How can I unset properly?

Thank you so much.

Comments