I want to read the text from a .docx file line by line and keep the each line data in an array, since .docx is a zipped file i want to convert it into a .doc file so that I can read the file using @fopen($filename, 'r');.
Below is the code I tried using PHPWord to conver from .docx to .doc ,
<?php
require_once 'phpWord/PHPWord.php';
$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('BasicTable.docx');
// Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('BasicTable4.doc');
?>
and this creates an erroneous .doc file.