Home  >  Article  >  Backend Development  >  PHP operates Excel files with Chinese content and exports files

PHP operates Excel files with Chinese content and exports files

墨辰丷
墨辰丷Original
2018-06-09 09:26:091305browse

This article mainly introduces the PHP operation of Excel files with Chinese content and file export. Interested friends can refer to it. I hope it will be helpful to everyone.

The example of this article describes the export of Chinese content excel file class by php, the details are as follows:

 
   
   
   
   
  
'; echo''; echo''; if(is_array($mapping)) { foreach($mapping as $key=>$val) echo""; } echo''; foreach($datalist as $k=>$v){ echo''; foreach($v as $key=>$val){ if(is_numeric($val) && strlen($val)>=14){ echo""; //大于14位的数字转换成字符串输出(如身份证) }else{ echo""; } } echo''; } echo'
".$val."
".$val."".$val."
'; echo''; echo''; } } $map=array('No','Name','Email'); $datal=array(array(1, '管理员', 'admin@163.com'), array(2, 'member', 'member@163.com'));; $csv=new toExcel; $csv->toExcel($map,$datal,"dataexport"); ?>

Method 2

Summary: The above is this article The entire content, I hope it will be helpful to everyone's study.

Related recommendations:

PHP examples analyze the usage skills of mysql transaction processing

php is implemented based on curl Multi-threaded crawling

php creates linked lists and adds, deletes, updates and traverses linked list nodes

The above is the detailed content of PHP operates Excel files with Chinese content and exports files. For more information, please follow other related articles on the PHP Chinese website!

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