Home >php教程 >php手册 >list与push的区别

list与push的区别

WBOY
WBOYOriginal
2016-06-13 10:03:181565browse

list与push的区别是什么?

//函数list
            while(list($id,$username,$password,$add_date,$mdn,$mobile,$channel,$last_date,$area,$nickname) = mysql_fetch_array($rs)){
                    $article[$i]['id'] = $id;
                    $article[$i]['add_date'] = $add_date;
                        $article[$i]['mdn'] = $mdn;
                    $article[$i]['last_date'] = $last_date;
                        $article[$i]['area_id'] = $area;
                        $article[$i]['nickname'] = $nickname;
                    $i ++;
               }

//函数array_push
            while($row  = mysql_fetch_array($rs)){
                    $article = array_push($row);
               }

这两个函数有什么是:

list不创建数组,直接赋值,而push用于追加数组项

 

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
Previous article:ip地址的正则表达式Next article:in_array函数的用法