// Following results in Exception
// ErrorException : Phpdocx\Elements\CreateProperties::createProperties(): unterminated entity
// reference co.
$docx = new CreateDocx();
$docx->addProperties([
'title' => "John & co.",
'creator' => "John & co.",
'lastModifiedBy' => "John & co.",
'description' => "John & co.",
]);
$docx->createDocx("test.docx");
// Following results in a warning when opening the Word document (some unreadable content has been
// found...). If we recover the document it is fine, but of course we don't want to give such a
// document to our customers
$docx = new CreateDocx();
$docx->addProperties([
'title' => htmlentities("John & co."),
'creator' => htmlentities("John & co."),
'lastModifiedBy' => htmlentities("John & co."),
'description' => htmlentities("John & co."),
]);
$docx->createDocx("test.docx");
The above code causes issues, and we could not find a way to get around it. How do we put special characters in document properties?