I hope that this is really an easy question I have, but I am finding it very difficult to find an answer to it.
Let's say that I have an array consisting of (1,2,3,3,2,3,4,5,3).
Using array_count_values, I can retrieve the amount of times one of these values appears in an array. So for example:
$quantity = array_count_values (1,2,3,3,2,3,4,5,3)
$quantity[3] = 4
Now, let's say that I want to change the number of times 3 appears in the array. Instead of it appearing 4 times, I want it to appear 2 times. The updated example array should be (1,2,3,3,2,4,5) (sorting doesn't matter, just contents)
Is there a way to update the $quantity[3] value so that it updates the full array? If so, how would I do this? If not, is there a work around?
I have a terrible tendency of looking over the most simple and direct answers, so I wouldn't be surprised if I'm missing something that is painfully obvious. Any and all help is appreciated.