Scope Woes - IF statement nested in WHILE statement -PHP
I have an array $actuals_sum.
<?php
while(condition s)
{
if($i == '24)
{
$actuals_sum[$j] = 'bar';
$j = $j + 1;
}
}
echo $actuals_sum[1];
?>
---------
but.... it throws an ERROR and says $actuals _sum is undefined....
So the scope is LOCAL, i need to make it return GLOBAL.
-Hyrum
Reply With Quote
I have an array $actuals_sum.
<?php
while(condition s)
{
if($i == '24)
{
$actuals_sum[$j] = 'bar';
$j = $j + 1;
}
}
echo $actuals_sum[1];
?>
---------
but.... it throws an ERROR and says $actuals _sum is undefined....
So the scope is LOCAL, i need to make it return GLOBAL.
-Hyrum
Reply With Quote
Comment