Home >php教程 >php手册 >PHP输出excel文件实例代码

PHP输出excel文件实例代码

WBOY
WBOYOriginal
2016-06-13 10:40:07964browse

PHP输出excel文件实例代码

  1. header("Content-type:application/vnd.ms-excel");   
  2. header("Content-Disposition:attachment;filename=users.xls" );   
  3. echo   "公司名称"." ";      
  4. echo   "用户名"." ";      
  5. echo   "密码"." ";     
  6. echo   "二级域名"." ";     
  7. echo   " ";    
  8. foreach($result[result] as $val){   
  9.     echo   "$val->ComName"." ";      
  10.     echo   "$val->UserName"." ";      
  11.     echo   "$val->UserTruePw"." ";    
  12.     echo   emptyempty($val->DoMainName)?:(http://.$val->DoMainName..jiaomai.com)." ";    
  13.     echo   " ";    
  14. }   
  15. ?>

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