Hi,
I am learning PHP at a local college.
I come across the folowing code, which I have questions about
while ($row = mysqli_fetch_array($result))
{
$jokes[] = array('id' => $row['id'], 'text' => $row['joketext'];
}
I want to know
1) is jokes[] a multi-dimensional array ?
2) If it is how do you refer to the joketext of the third joke. is this answer $jokes[3,2]?
multi dimensional arrays
Moderator: General Moderators
Re: multi dimensional arrays
1. Yes, it is a multi-dimensional array.
2. The syntax is $arr[$x][$y]. You can nest to an arbitrary depth (if you happen to think that's a good idea).
2. The syntax is $arr[$x][$y]. You can nest to an arbitrary depth (if you happen to think that's a good idea).