This is probably very simple but I cannot figure it out and my searches have come up blank.
Here is what I have in mind:
<?php
$var1 = 0.0;
for ($i=1;$i<10;$i++){
$var1 = $var1 + $i;
}
echo $var1[4]; // This would give 0, I believe.
?>
I hope my example made it clear what I’m trying to do, and I’m sure there is a simple solution, I just unfortunately cannot find it.
Thanks,
Sam
1 Answer