Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. $source = __DIR__ . "/Resumes/Curriculum-Vitae-Template.rtf";
  2. $phpWord = PhpOfficePhpWordIOFactory::load($source, 'RTF');
  3. $sections = $phpWord->getSections();
  4. foreach ($sections as $key => $value) {
  5. $sectionElement = $value->getElements();
  6. foreach ($sectionElement as $elementKey => $elementValue) {
  7. if ($elementValue instanceof PhpOfficePhpWordElementTextRun) {
  8. $secondSectionElement = $elementValue->getElements();
  9. foreach ($secondSectionElement as $secondSectionElementKey => $secondSectionElementValue) {
  10. if ($secondSectionElementValue instanceof PhpOfficePhpWordElementText) {
  11. echo $secondSectionElementValue->getText() . '<br/>';
  12. }
  13. }
  14. }
  15. }
  16. }
  17. die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement