Home > php教程 > PHP源码 > body text

PHPWORD

PHP中文网
Release: 2016-05-25 16:58:32
Original
1626 people have browsed it

跳至

建立一个Word文件Template.docx
欲替换的值地方${name}
思路:
仿照smarty,
模板文件一定要命名为docx,后缀
前提,先下载开源类PHPWord,PHP开启ZIP拓展
loadTemplate('Template.docx');
        $document->setValue('name', 'xeay');
	$document->setValue('class', '软件一班');
	$document->setValue('No', '1108000xxxx');
	$document->setValue('telephone', '1885022xxxx');
	$document->setValue('why', 'ACM');
	$document->setValue('signname', 'xeay'); 
	$document->save('image.docx');
?>
Copy after login

                   

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!