Hi everyone,
Hoping this is a simple question and I can explain it well.
Let’s say I have the following array:
$measurements = array (
'',
'Teaspoons',
'Tablespoons',
'Ounces'
);
It is my understanding that if you don’t define a key, then it uses numbers starting at 0.
So:
0 = blank
1 = Teaspoons
2 = Tablespoons
3 = Ounces
Let’s say I’m using the above array in a drop down field in WordPress. The information is being saved as a custom field.
What if in the future I decide that I need to add more entries to the array. So let’s say I add the following:
$measurements = array (
'',
'Teaspoons',
'Boxes', // new entry added
'Tablespoons',
'Ounces'
);
Because I added the new entry between already existing entries, does that mean that the key numbers for the others have been thrown out of whack? Previously, Tablespoons was 2. Now it would be 3. And if so, then I’m assuming that anything I’ve filed previously will also be thrown out of whack correct?