From the course: PHP: Exporting Data to Files

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Creating a .docx file to use as a template

Creating a .docx file to use as a template - PHP Tutorial

From the course: PHP: Exporting Data to Files

Start my 1-month free trial

Creating a .docx file to use as a template

In the previous chapter, we use this web page to generate and open document text file with the same content, including the images. In this chapter, we'll follow a similar process to generate download file in Microsoft Word format. Just to remind you, this page has a main heading, flower arrangements, and each section follows the same pattern. It has a subheading, image, price, and a series of descriptive paragraphs. We need to create a template in Microsoft Word to replicate this layout. It won't be exactly the same, but it'll be very similar. I'm going to be using Microsoft Word 2013, but you can use any version of Word since Word 2007 for Windows, or Word 2008 for Mac. They all store the content internally in an XML format similar to open document text files. Older versions of Word store the content in a proprietary binary format so you must use Word 2007 or later. So in my blank document I'm going to create a heading one, flower arrangements, then a heading two, this will be a…

Contents