open($file, \ZipArchive::CREATE); $zip->addFromString('document.xml', '' . $documentXml . ''); $zip->close(); $documentReader = new Document($file, 'document.xml'); $documentReader->read($phpWord); unlink($file); return $phpWord; } /** * Returns the element at position $index in the array * * @param array $array * @param number $index * @return mixed */ protected function get(array $array, $index = 0) { return $array[$index]; } }