Pushing values to an array caused the index to start with 0 if the index were any other values except starting from 0.
$a=array("a"=>"Dog","b"=>"Cat");
array_push($a,"Horse","Bird");
this will insert Horse and Bird with index 0 and 1.
Can I insert those values with different index? like
speed => Horse
fly => Bird
Yes, by not using array_push
at all:
$a['speed'] = 'Horse';
$a['fly'] = 'Bird';