I’m trying to solve this problem where I have a unique array of values within a specific range. Take this scenario: Generate a fixed value array (90) with unique entries. If you find a duplicate, remove, reindex, and fill the void. I’m running into the problem that conditional statements do not allow you to interact with an array outside of it’s scope. I’m aware of array_unique but it doesn’t refill those gaps, just makes them. How do I refill those gaps?
EDIT: This was a noobish question about scoping. A simple while loop demonstrated that if conditional statements can modify variables outside of it’s scope.
?>
Not sure if this will help but you can always reiterate over the array once the duplicateds have been removed and reindex it if that is what you mean?