I know there are a lot of topics about this, but just couldn't find any that would actually help me solve the problem. Ok so i am having a problem with counting rows and values in multidimensional array (imported via .csv)
I am trying to achieve something like...
Array ( [0] => Array ( [0] => 1 [1] => 6278,31 [2] => 4)
[1] => Array ( [0] => 2 [1] => 2,0 [2] => 2)
[2] => Array ( [0] => 3 [1] => 3,01 [2] => 3)
)
where [0] would be buyer id, 1 is total number of buys and [2] total cost.
My current code:
if(($s_open = fopen("sales.csv", "r")) !== FALSE)
{
$s_count = count(file("sales.csv"));
while(($sales = fgetcsv($s_open, 100, ";")) !== FALSE)
{
...
}
fclose($s_open);
}
Thanks in advance.
