A php variable $a (which was set to a value earlier in the code) is being reset to a value of 0 and I don't want it to. At the end of the php code, I did an echo and $a was 0. So I made a debugging array to catch the value at various points. I found where it's getting set to 0. Here's the code:
$a = 1;
if($total> 0){
$a = ($a/$total);
$X["i"]=$a;
}
$X["ii"]=$a;
Output:
$x["i"]=1;
$x["ii"]=0;
A few things: There are no functions at all (and obviously not where it's being set to 0), and $a is a global. It's a very large php file. I'm wondering if memory is the problem...? No idea. I'm not a nube to php, or to programming.