I want to change the indexing of array for example. I have an array
$a = array("a","e","i","o","u");
echo $a[0]; //output a
It means this array has index (0,1,2,3,4)
Now I want to start my array from index 100 instead 0
Means array with index (100,200,300,400,500)
If you want to declare an array that way you should do:
Note that if you add a new element to the
$arrayin the shorter way ($array[] = 'f') the key assigned will be501.If you want to convert regular array indexes to hundreds-based ones you can do this:
But perhaps you don’t really need to convert no array and instead access your current one this way: