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
[4]on a scalar variable$var1. If not for that, it would work.loopscope, it is accessible outside of theloop.$var1as an integer, but you're treating it as an array in theechoat the end?