My screen shot on my project result I have a working IRR class but when i try using loop to create an array there is something different. when i input array manualy everything looks fine but when i use my while code Warning: Division by zero show up. i dont know where is the different betwen my manual array and while array. after i try to print those two value, the value is exacly the same. Thanks for your help``
Here is my code
$arrayIRR="";
$x=1;
while($x <= $row) {
if ($x<$row){
$varkoma =",";
}
else ($varkoma = "");
$arrayIRR = $arrayIRR.$varAngsuran.$varkoma;
$x++;
}
echo "<br>";
echo "Array: ".$arrayIRR;
echo "<br>";
echo "Array: 1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000";
echo "<br>";
//echo $varPreIRR=100*12*IRRHelper::IRR(array($varNPlafon,$arrayIRR));
echo "Nilai IRR :" ;
echo IRRHelper::IRR(array(-18000000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000,1725000));
echo "<br>";
echo "Nilai IRR :" ;
echo IRRHelper::IRR(array(-18000000,$arrayIRR));