header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment; filename=test_data.xls");
echo ‘ID‘.chr(9);
echo ‘txtPEOClientCode‘.chr(9);
echo ‘jcompany‘.chr(9);
echo ‘fcompany‘.chr(9);
echo ‘ecompany‘.chr(9);
echo ‘rcompany‘.chr(9);
echo ‘txtAddress‘.chr(9);
echo ‘txtCompanyTel‘.chr(9);
echo ‘txtFax‘.chr(9);
echo ‘txtPostCode‘.chr(9);
echo chr(13);
$user_list = M(‘User‘)->select();
foreach ($user_list as $key => $value) {
echo ‘‘;
echo $value[‘id‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo $value[‘phone‘].chr(9);
echo chr(13);
}
本文出自 “天南一方” 博客,请务必保留此出处http://phpnan.blog.51cto.com/2641199/1655133
原文地址:http://phpnan.blog.51cto.com/2641199/1655133