Once installed, you can use it in your code like this (taken from the documentation):// Creating the new document...$phpWord = new \PhpOffice\PhpWord\PhpWord();/* Note: any element you append to a document must reside inside of a Section. */ // Adding an empty Section to the document...$section = $phpWord->addSection();// Adding Text element to the Section having font styled by default...$section->addText( htmlspecialchars( '"Learn from yesterday, live for today, hope for tomorrow. ' . 'The important thing is not to stop questioning." ' . '(Albert Einstein)' ));// Saving the document as HTML file...$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');$objWriter->save('helloWorld.html'); 这篇关于PHPWord在Laravel 5中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-11 09:15