How to convert .docx file into .doc file with PHP? -


i want read text .docx file line line , keep each line data in array, since .docx zipped file want convert .doc file can read file using @fopen($filename, 'r');.

below code tried using phpword conver .docx .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 creates erroneous .doc file.

if want text out of .docx file , save text file can use library docx2text

after converting text file can read text file line line , keep each line data in array.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -