1

I want to extract text from an msword file (eg: .docx) to use the content of msword file in my PHP script.

Is it possible to get all pages in an array of php? Like

$array = [
   [0] => 'content here......',
   [1] => 'content here......',
   [2] => 'content here......',
];

where index 0 is page one, index 1 is page two and so on.

M.suleman Khan
  • 576
  • 6
  • 17

1 Answers1

1

I have done it Myself i used a class

https://github.com/abhihub/EDUSITE/blob/master/DocxConversion.php

$docObj = new DocxConversion("example.docx");
$docText= $docObj->convertToText(1);

and i got my desired result

Posting this answer because maybe someone needs it in Future

M.suleman Khan
  • 576
  • 6
  • 17
  • Hello, Please let me know is there way to convert this docx file to pdf file. – Stack user Jun 27 '19 at 05:19
  • I don't see it's returning docx' pages in your code? It supposed to split doxc file pages and return it as an array! – Kmaj Mar 12 '23 at 11:28