我已经设置了一个多维阵列中PHP是这样的:PHP多维数组元素被跳过
$contents = array(
"Header1" => array(
"Section 1" => array (
"Description1",
"Notes1",
),
"Gap" => "Gap",
"Section 2" => array (
"Description2",
"Notes2",
),
"Gap" => "Gap",
"Section 3" => array (
"Description3",
"Notes3",
),
),
);
然后我通过这个阵列循环如下:
foreach ($contents as $header => $section) {
foreach ($section as $title => $details) {
echo $title."<br>";
}
}
的输出将是:
Section1
Gap
Section2
Section3
为什么不是第二个“差距”显示?
Thanx
这就是为什么:http://codepad.org/zvuYLP6P。 – 2013-02-20 20:54:24