Home > php教程 > PHP源码 > PHPWORD

PHPWORD

PHP中文网
Release: 2016-05-25 16:58:32
Original
1706 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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template