Open Zoolootooy opened 1 year ago
I'm trying to get footnotes from a document, but for some reason I'm getting it twice.
$phpWord = IOFactory::load('./Test.docx'); $content = ''; $footnotes = $phpWord->getFootnotes()->getItems(); //Here I already have all footnotes twice foreach ($footnotes as $footnote) { $string = ''; foreach ($footnote->getElements() as $element) { if ($element instanceof \PhpOffice\PhpWord\Element\Text) { $string .= strlen($element->getText()) > 0 ?trim($element->getText()) . ' ' : ''; } // $string .= ' '; } $content .= $string . PHP_EOL; }
Any ideas why this is happening?
@Zoolootooy Could you a sample file ?
I'm trying to get footnotes from a document, but for some reason I'm getting it twice.
Any ideas why this is happening?