Re: php-general Digest 7 Apr 2001 12:32:53 -0000 Issue 613
| From: | jvoth at mobiltex dot com | Date: | Mon, 09 Apr 2001 15:39:33 +0000 |
| Subject: | Re: php-general Digest 7 Apr 2001 12:32:53 -0000 Issue 613 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47810@lists.php.net to get a copy of this message | ||
Hi Yasuo,
> Subject: Re: [PHP] Nested for() loops? -> Now Multi Dimension Arrays
> Date: Sat, 7 Apr 2001 12:57:02 +0900
> From: "Yasuo Ohgaki" <yohgaki@hotmail.com>
> To: php-general@lists.php.net
>
> Simple to fix it. You just need to resolve ambiguity with {}.
>
> > $res = $i * $j;
> > $target_array[$i][$j] = $res;
> > print("result = $target_array[$i][$j] <br>");
>
> print("result = {$target_array[$i][$j]} <br>");
>
> Regards,
> --
> Yasuo Ohgaki
Nope. Those curly brackets broke the code.
<?
error_reporting(E_ALL);
$target_array = array();
echo "starting <br>";
for( $i=0; $i<5; $i++ )
for( $j=0; $j<5; $j++ )
{
$res = $i * $j;
$target_array[] = $res;
print("result = {$target_array[$i][$j]} <br>");
}
echo "done<br>";
?>
This is the output without the curly brackets:
starting
result = 0[0]
result = 0[1]
result = 0[2]
result = 0[0]
result = 0[1]
result = 0[2]
done
This is the output with the curly brackets:
starting
result =
result =
result =
result =
result =
result =
done
Anyone have any ideas on how to make this work?
Thanks in advance!!
John