我想我只是有无效的语法,但对于我的生活我无法弄清楚。我有一个3个元素的嵌套数组。数组没有返回整个元素
$screenshot = array(array(Carousel => "Library.png", Caption => "Long caption for the library goes here", ListItem => "The Library"));
我使用for循环来编写一些包含元素的HTML。
<?php
for ($row = 0; $row < 4; $row++)
{
echo "<div class=\"feature-title\"><a href=" . $carousel_dir . $screenshot[$row]["Carousel"] . " title=" . $screenshot[$row]["Caption"] . " rel=\"lightbox[list]\">" . $screenshot[$row]["ListItem"] . "</a></div>";
}
?>
我的问题是“a”标签的“title”部分只包含第一个单词Long。所以在上面的情况下,它将是:
<div class="feature-title"><a href="/images_carousel/1A-Library.png" title="Long" caption for the library goes here rel="lightbox[list]" class="cboxElement">The Library</a></div>
任何人都可以阐明我的错误吗?提前致谢。
谢谢,我知道它必须是简单的东西。 – Bill 2012-03-01 04:30:35