Complex arrays inside quoted strings either need to be escaped with {}'s
or drop out of the quoted string to display them. ie.
echo "".$week[$i][$j].": ".$week[$i][$k][0]."";
or
echo "${week[$i][$j]}: ${week[$i][$k][0]}";
-Rasmus
On Fri, 29 Mar 2002, David Johansen wrote:
> Ok, I have a que
On Fri, 29 Mar 2002, David Johansen wrote:
> Ok, I have a question about arrays and indexes. Something weird happens when
> I try this:
>
> echo "week[$i][$j]: $week[$i][$k][0]";
If you're array subscripts inside "double quotes", then use {braces}
around the entire variable:
echo "week[$i][$
Ok, I have a question about arrays and indexes. Something weird happens when
I try this:
echo "week[$i][$j]: $week[$i][$k][0]";
Of course $i and $j have their appropriate values. It just prints out
Array[0][4] (0 and 4 being the values of $i and $k, but if I do the code
below it works just fine.
3 matches
Mail list logo