Re: Strange Array Error

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

 



On Thu, 21 Oct 2004 14:28:26 +0100, Shaun <shaunthornburgh@xxxxxxxxxxx> wrote:
> I have been trying for the past two hours to understand why I get an error
> with the following code:
> 
> <?php
>  $test_array[] = array();

$test_array = array();

>  $i = 0;
>  while($i < 7){
>   $test_array[$i] += $i;

$test_array[$i] = $i++;  // maybe what you want ?

>   echo '$day_total[$i] = '.$day_total[$i].'<br>';
>  }
> ?>
> 
> Fatal error: Unsupported operand types in
> /usr/home/expensesystem/public_html/test.php on line 5
> 
> I am trying to create a loop where $i is added to array element $i, and
> can't find any information relating to this on google or php.net...


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux