Page 1 of 1

multidimensional arrays

Posted: Sat Feb 23, 2008 1:26 pm
by Todlerone
Hello everyone and again thank-you in advance for any replies. Can this happen in an array

Code: Select all

$standings[$x][0]=$standings[$x][0]+1;
That is, the contents of a cell be incremented and replaced or does one have create another level of the array.

Thanks :roll:

Re: multidimensional arrays

Posted: Sat Feb 23, 2008 2:12 pm
by Christopher
Yes, you can do that. To just increment you can also do:

Code: Select all

++$standings[$x][0];
// or
$standings[$x][0] += 1;
They all do the same thing.