Im read word file with PHPWord libary
$objReader = \PhpOffice\PhpWord\IOFactory::createReader('Word2007');
$phpWord = $objReader->load($_FILES["fileToUpload"]['tmp_name'], "UTF-8");
foreach ($phpWord->getSections() as $section) {
$arrays = $section->getElements();
foreach ($arrays as $e) {
if (get_class($e) === 'PhpOffice\PhpWord\Element\TextRun') {
foreach($e->getElements() as $text) {
echo $text->getText();
}
}
}
The problem is that i cannot detect a EOF character, i spent a lot of time to resolve this problem but didnt work at all.