我想我只是有無效的語法,但對於我的生活我無法弄清楚。我有一個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