Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有月数组$months('January', 'February', 'May')
$months('January', 'February', 'May')
并希望在本月循环显示
{for $foo=1 to 3} {$months[$foo]} {/for}
我得到白页,我的代码有什么问题?
首先,确保您正确定义了数组:
$months = array('January', 'February', 'May');
然后,确保索引正确(在 PHP 数组中,索引从 0 开始):
{for $foo=0 to 2} {$months[$foo]} {/for}