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.
我有这行代码:
// echo the name of one forum (without additional DB query) echo ($mybb->cache->cache['forums'][19][name]);
这给出了一个论坛的名称。我需要通过“查询”数组来列出所有论坛。显然,一个简单的数据库查询可以做到这一点,但信息已经可用。
如何迭代所有“论坛”并呼应他们的名字?
foreach($mybb->cache->cache['forums'] AS $forum_id => $forum_data) { echo '<li>'.$forum_data['name'].'</li>'; }