I have the following array:
[answer] => Array
(
[0] => A
[2] => E
)
I run the following code:
for ($i = 0; $i < 3; $i++){
if (!isset(answer[$i]))answer[$i] = "X";
}
and get the following:
[answer] => Array
(
[0] => A
[2] => E
[1] => X
)
Is there a way to preserve the order so we get:
[answer] => Array
(
[0] => A
[1] => X
[2] => E
)