Ok I whole-heartedly belive that PHP, or at least my PHP is cursed. In my post above there, the last element in the array is not supposed to be an 8, although that is what is in the array! I changed a foreach loop for another variable and an 8 happened right there out of nowhere!
With this code the contents of the two print_r are different! (the one with the last value of 8!)
echo '1>>>>>>>>>>>>>>>>>>>'."<br>";
print_r($temp);
echo '1>>>>>>>>>>>>>>>>>>>'."<br>";
for ($c=1; $c < sizeof ($age_groups); $c=$c+1)
{
echo "";
}
echo '>>>>>>>>>>>>>>>>>>>'."<br>";
print_r($temp);
echo '>>>>>>>>>>>>>>>>>>>'."<br>";
With this code, there are the same (as they should be!) Can someone please tell me why!
echo '1>>>>>>>>>>>>>>>>>>>'."<br>";
print_r($temp);
echo '1>>>>>>>>>>>>>>>>>>>'."<br>";
for ($cz=1; $cz < sizeof ($age_groups); $cz=$cz+1)
{
echo "";
}
echo '>>>>>>>>>>>>>>>>>>>'."<br>";
print_r ($temp);
echo '>>>>>>>>>>>>>>>>>>>'."<br>";
This is what is there now in both arrays. As it should be.
Array
(
[0] => Array
(
[techtv] => Array
(
[0] => 6
)
)
[7] => Array
(
[techtv] => Array
(
[0] => 1
[1] => 3
)
)
[8] => Array
(
[techtv] => Array
(
[0] => 1
[2] => 3
)
)
[9] => Array
(
[techtv] => Array
(
[0] => 3
)
)
[10] => Array
(
[techtv] => Array
(
[0] => 3
)
)
[11] => Array
(
[techtv] => Array
(
[0] => 3
)
)
[12] => Array
(
[techtv] => Array
(
[0] => 2
[1] => 3
)
)
[13] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[14] => Array
(
[techtv] => Array
(
[0] => 2
[1] => 4
[2] => 5
)
[NatCore] => Array
(
[0] => 8
)
[notebook] => Array
(
[0] => 6
[1] => 4
)
)
[15] => Array
(
[techtv] => Array
(
[0] => 2
)
[notebook] => Array
(
[0] => 6
)
)
[16] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[17] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[18] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[19] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[20] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[21] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[22] => Array
(
[techtv] => Array
(
[0] => 2
)
)
[23] => Array
(
[techtv] => Array
(
[0] => 1
)
)
)
How did the array get 'corrupted' when I had a $c and back to normal when I put a $cz instead! :mad: