echoing a multi-dimensional array
Posted: Tue Jun 06, 2006 3:33 pm
I can't fathom out echoing an array!
Here's my code to try and understand it all
which produces
why doesn't produce ?
Here's my code to try and understand it all
Code: Select all
print_r ($matches);
echo "<p>$matches[0][2]<p>$matches[1][2]<p>";
$first=$matches[1];
echo "0=$first[0]<p>1=$first[1]<p>2=$first[2]";Code: Select all
Array ( [0] => Array ( [0] => Wed - Jun 07 -- Thu - Jun 08
[1] => [2] => Wed - Jun 07 -- Thu - Jun 08 [3] => [4] => Wed - Jun 07 -- Thu - Jun 08 [5] =>
) [1] => Array ( [0] => Sun - Jun 11
[1] => [2] => Sun - Jun 11 [3] => Sun - Jun 11 [4] => [5] =>
) )
Array[2]
Array[2]
0=Sun - Jun 11
1=
2=Sun - Jun 11Code: Select all
echo "$matches[0][2]";Code: Select all
Wed - Jun 07 -- Thu - Jun 08