PHPWord
PHP library for reading and writing word processing documents
... and unit testing. Set document properties, e.g. title, subject, and creator. Create document sections with different settings, e.g. portrait/landscape, page size, and page numbering. Create header and footer for each sections, set default font type, font size, and paragraph style. Use UTF-8 and East Asia fonts/characters. Define custom font styles (e.g. bold, italic, color) and paragraph styles (e.g. centered, multicolumns, spacing) either as named style or inline in text.