dedecms织梦后台增加批量上传和导出报表的功能

    <?php  

               require_once (dirname(__FILE__) . "/../include/common.inc.php");  

                $output = fopen('','w') or die("can't open ");  

                            header('Content-Type: application/csv');  

                            header('Content-Disposition: attachment; filename="认证列表.csv"');  

                            $arrkeys = array(  

                                iconv('utf-8','gb2312','姓名'),  

                                iconv('utf-8','gb2312','电话')//文件表头  

                                );  

                            fputcsv($output, $arrkeys);  

                            //取得符合条件的数组  

                             $sql = "SELECT * FROM dede_test";  

                               $dsql->Execute('me',$sql);  

                           while($row = $dsql->GetArray('me')){  

                                    $name =$row['name'];  

                                    $mobile= $row['mobile']; //循环  

       

                                    $arrkeys = array(  

                                        iconv('utf-8','gb2312',$name),  

                                        iconv('utf-8','gb2312',$mobile)  

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ed4d974c0141d279cd0506656420436a.html