Home > Backend Development > PHP Tutorial > discuz是怎么把数据表转成数组的

discuz是怎么把数据表转成数组的

WBOY
Release: 2016-06-13 12:06:52
Original
979 people have browsed it

discuz是如何把数据表转成数组的?
下面这组数据是频道栏目表中的,我的疑问是 discuz 如何把数据表中的数据转成数组的呢?

Array<br />(<br />    [0] => Array<br />        (<br />            [catname] => 频道栏目1<br />        )<br /><br />    [1] => Array<br />        (<br />            [catname] => 频道栏目2<br />        )<br /><br />    [2] => Array<br />        (<br />            [catname] => 频道栏目3<br /><br />    [3] => Array<br />        (<br />            [catname] => 频道栏目4<br />        )<br /><br />    [4] => Array<br />        (<br />            [catname] => 频道栏目5<br />        )<br /><br />    [5] => Array<br />        (<br />            [catname] => 频道栏目6<br />        )<br />   <br />)
Copy after login

------解决思路----------------------
一个while循环取出的资源就自己组织成数组啊
你看看\source\class\discuz\discuz_database.php,fetch_all()方法

我都是从入口文件开始找,用file_put_content()来输出我想要的数据
你可以用NetBeans,只要引入discuz,你就可以用control+鼠标左键,自动跳到定义该方法的文件中

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template