- Posts: 14220
- Thank you received: 4335
Ask the community, share ideas, and connect with other LimeSurvey users!
<?php echo "Sum of 90, 0.4, 0.4, 1.2 and 8<br><br>"; $i1=90; $i2=0.4; $i3=0.4; $i4=1.2; $i5=8; $sum=$i1+$i2+$i3+$i4+$i5; echo "Sum: ".$sum."<br>"; echo "Sum equal 100: ";if($sum==100) {echo "true";} else {echo "false";} ?>
<?php echo "array_sum([90,8,0.4,0.4,1.2]) = ".array_sum([90,8,0.4,0.4,1.2])."<hr>"; echo "array_sum([90,8,0.4,0.4,1.2]) == 100 : "; echo (array_sum([90,8,0.4,0.4,1.2]) == 100) ? 'true' : 'false';