Re: adding in array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



for($i=0;$i<5;$i++){
     for($j=0;$j<5;$j++){
          $new_array[$i]+=$j;
     }
}
for($i=0;$i<5;$i++){
     print($new_array[$i]);
}

this works, so Vogt's solution should solve your problem

> Lets say $year is 2000
> There is not defined index 2000 at $array.
> It is going to be undefined offset.

PHP is set up in a way that it handles that kind of problem itself, so no
need to worry about undefined variables

-Peter




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux