Page 1 of 1

Silly mistake

Posted: Sun Dec 16, 2007 11:56 am
by fredley
I'm loading up an array using a loop. It has two tiers, so two while loops using $i and $j. No prizes for guessing what this code does.

Code: Select all

...
$C[$i][$j] = ($first*$fourth - $second*$third)/$determinant;
...
However all I get is an array of 0s. If I echo each term instead of assign it I get the correct output. I also know the array is being created correctly, the values are just not loading in for some reason. Any ideas what's going wrong?

Fred

Posted: Sun Dec 16, 2007 12:00 pm
by John Cartwright
You've given us insufficient info. The more data you give the easier the problem is to asses. Try changing that line to see the actual result and post the results.

Code: Select all

var_dump(($first*$fourth - $second*$third)/$determinant);
echo '<br />';