使用fopen文件操作函数来做,需要注意的直接生成中文文件名会乱码,(生成word和微软的编码不一样)需要转码生成。word内容保持utf8编码就好。

            $file_name = iconv("UTF-8", "GBK", $detail['name']);
$fp = fopen('./uploads/'.$file_name.'_'.$userid.'.doc', 'w+');
$fileContent = '';
$fileContent.= "姓名:".$detail['name']."\r\n";
$fileContent.= "性别:".$detail['sex']."\r\n";
$fileContent.= "会员级别:".$detail['member_type']."\r\n";
$fileContent.= "职务:".$detail['zhiwu']."\r\n";
$fileContent.= "联系电话:".$detail['phone']."\r\n";
$fileContent.= "邮箱:".$detail['email']."\r\n";
$fileContent.= "公司名称:".$detail['gongsi']."\r\n";
$fileContent.= "公司地址:".$detail['gongsi_dizhi']."\r\n";
$fileContent.= "助理电话:".$detail['zhuli_dianhua']."\r\n";
$fileContent.= "助理姓名:".$detail['zhuli_mingzi']."\r\n";
$fileContent.= "助理邮箱:".$detail['zhuli_youxiang']."\r\n";
fwrite($fp, $fileContent);
fclose($fp);
echo "<script>alert('添加成功');window.location.href='".site_url()."/index/joinUs';</script>";

最新文章

  1. nginx配置入门
  2. 速度!!!抢KIS英文版(多设备版)3年激活码
  3. onClick(View) of type new View.OnClickListener(){} must override a superclass method
  4. COB(Chip On Board)的製程簡單介紹
  5. python中变量命名
  6. 在C语言中基本数据类型所占的字节数
  7. codeforces 659C Tanya and Toys
  8. Android调试优化篇
  9. java数据结构之有序表查找
  10. Ubuntu中创建Python虚拟环境
  11. &ldquo;正在注册字体&rdquo;问题解决
  12. Scala_关键字
  13. 查看python中已安装的包有哪些
  14. Python3基础 __doc__ 单行与多行函数文档
  15. linux之tmpfs
  16. C#线程篇---让你知道什么是线程(1)
  17. Redis学习十一:Redis的Java客户端Jedis
  18. python接口自动化3-自动发帖(session)
  19. linux centOs中安装好数据库,客户端用plsql连接oracle
  20. @ResponseBody注解返回中文乱码

热门文章

  1. Ubuntu/CentOs 搭建SVN服务器
  2. BZOJ4011: [HNOI2015]落忆枫音(dp 乘法原理)
  3. LintCode2016年8月22日算法比赛----克隆二叉树
  4. [算法练习]Excel Sheet Column Title
  5. Grunt入门学习之(3) -- Gruntfile具体示例
  6. C#中的基础数据类型
  7. 秒杀多线程第一篇 多线程笔试面试题汇总 ZZ 【多线程】
  8. python之内置函数,匿名函数
  9. 字典构造、合并(dict)、排序
  10. JFinal启动报错:Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector