Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $source = __DIR__ . "/Resumes/Curriculum-Vitae-Template.rtf";
- $phpWord = PhpOfficePhpWordIOFactory::load($source, 'RTF');
- $sections = $phpWord->getSections();
- foreach ($sections as $key => $value) {
- $sectionElement = $value->getElements();
- foreach ($sectionElement as $elementKey => $elementValue) {
- if ($elementValue instanceof PhpOfficePhpWordElementTextRun) {
- $secondSectionElement = $elementValue->getElements();
- foreach ($secondSectionElement as $secondSectionElementKey => $secondSectionElementValue) {
- if ($secondSectionElementValue instanceof PhpOfficePhpWordElementText) {
- echo $secondSectionElementValue->getText() . '<br/>';
- }
- }
- }
- }
- }
- die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement