Answer the question
In order to leave comments, you need to log in
What is the best way to parse Word?
Previously, you had to convert source files to txt and manually add tags... and already parse the file, adding table and image tags manually...
A lot has changed in 3-4 years... suddenly, Word parsing has become easier?
The PHPWord library has advanced a lot .. but I can’t find a clear recipe for how to parse the text into an array of strings, values ..
https://github.com/PHPOffice/PHPWord/blob/develop/...
There is an example, but it outputs to a file ..
made print_r $phpword - there is a whole mess...
Maybe someone met?
The ultimate task:
There is a Word document - a kind of questionnaire ... The structure is very stupid.
Question: 1. Blah blah blah
The answer is in any form... different formatting, tables, pictures, in general, whatever the "responder" gets into his head.
Question 2...
...
Question N ...
...
As a result, you need to get an array:
[question1]=> ...
[question2]=> ...
What do you recommend?
Answer the question
In order to leave comments, you need to log in
What do you advise?Getting to grips with PHPWord doesn't hurt.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question