ini_set(
'display_errors'
, 1);
ini_set(
'display_startup_errors'
, 1);
error_reporting(E_ALL);
require_once
'vendor/autoload.php'
;
include_once
'phpoffice/PhpWord/PhpWord.php'
;
include_once
'phpoffice/PhpWord/TemplateProcessor.php'
;
use TemplateProcessor, Shared\Html, PhpWord;
$getfile1 =
new
\PhpOffice\PhpWord\TemplateProcessor(
'blankfield1.docx'
);
var_dump($getfile1->getVariables());
$getfile2 =
new
\PhpOffice\PhpWord\TemplateProcessor(
'blankfield2.docx'
);
var_dump($getfile2->getVariables());
$getfile3 =
new
\PhpOffice\PhpWord\TemplateProcessor(
'blankfield3.docx'
);
var_dump($getfile3->getVariables());
$getvar = $getfile1->getVariables();
echo
'Number of Variables: '
.count($getvar).
'<br>'
;
for
($i=0; $i<count($getvar); $i++) {
echo
'varname ['
.$i.
']: '
.$getvar[$i].
'<br>'
;
}