I store numbers in an array in the following way:
467:0
where 467 is the number and 0 is the number of occurances.
What am doing is I grab a bunch of numbers from the db and then I look for numbers that appear more then once, if they do incredement the number of occurances.
$numberCount = explode(':', $this->_presentationArr);
if(in_array($numberprefix . ':' . preg_match('/^\d+$/', $numberCount[1]), $this->_presentationArr))
{
$pos = array_search($numberprefix . ':' . preg_match('/^\d+$/', $numberCount[1]), $this->_presentationArr);
$tmpArr = explode(':', $this->_presentationArr[$pos]);
$tmpArr[1]++; # this does not work
}
The $tmpArr[1] is the number that needs to be incredementet for each match. Any ideas?