Home  >  Article  >  Backend Development  >  php-求助高手,死板循环输出数组用得不爽,有没有更好的输出方法?

php-求助高手,死板循环输出数组用得不爽,有没有更好的输出方法?

WBOY
WBOYOriginal
2016-06-02 11:28:351029browse

php

比如我要输出分类表的数据,原来是这样死板的输出数组
//读取主类型。
$sql_0="select * from category where category_parent_id = 0 " ;
$query_0=mysql_query($sql_0);
while($rs_0 = mysql_fetch_array($query_0))

{
?>
" >


}
?>

定义一个频道页,输出 【分类ID】 放到频道超链接,再输出分类名。
但是公司的【关于我们】【新闻动态】都是文章,可以放在article_channel.php
【公司相册】很多内容不一样,我想获取ID把链接放在xiangce_channel.php
【公司视频】把id放在video_chaanel.php

我会用while,现在我不想用while。

Statement:
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