I have an array with some values in different spots. I want to check if there is a value in the index then put it in a new array starting at 0 then put in index 1 then next value at index 2 and so on. I need to shorten it and move them all to the left really.
Array ( [0] => 53 [1] => [2] => 55 [3] => 76 [4] => [5] => [6] => [7] => )
The new array would be:
newArray ( [0] => 53 [1] =>55 [2] => 76)
Maybe something like this:
for ($i=0; $i < sizeof($questionWorth); $i++)
{
if($questionWorth[$i] has a value)
{
put it in new array starting at index zero
then increment the index of new array
}
}