The code is kinda big so I want to avoid posting it here.
http://codepad.org/ARzh7ya9
What am trying to do is I load a bunch of numbers into an array. All these numbers have prefixes whereever they are local, mobile or shared.
$this->callArr contains numbers such as 46703920293:402 or 4629304921:94 (number:duration of call).
As you can see 4670 is one prefix and 46 is another. This may seem confusing at first but the later is a local call and the first is a mobile call.
What I am doing: for each number in callArr, first explode to seperate number and duration. Then remove the country code in this case 46 then only grab the first two numbers.
46703920293 would magically turn into 70 indicating it is an mobile number.
Then for each number go through the pricelist array $this->priceArr.
The priceArr have the following structure number:price:type:oa.
Example: 4670:0.65:mobile:0.15
The pricelist only contain the prefix. oa = opening costs for a call.
On line 27 I check if the length of the $number (which is the pricelist prefix) is == 2. If it is it's a 46 number which is local. If it's not then remove the 46(country code).
The issue is at line 41. He can find all mobile matches, all free cost and shared. But he have issues grabbing the local calls. Can anyone see what am doing wrong here?
A lot of text hope you bear with me!