nadirhamid / docx-to-html
composer integration of xylude/Docx-to-HTML
Installs: 19 388
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 23
Language:HTML
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-03-29 00:31:13 UTC
README
Converts .docx files to HTML
This is a PHP class that will convert your .docx files to HTML. It is by far not perfect, but will handle most things decently.
This class requires the following:
Composer install
composer require nadirhamid/docx-to-html
###How to use
include('./docx_reader.php');
$doc = new Docx_reader();
$doc->setFile('./sample.docx');
if(!$doc->get_errors()) {
$html = $doc->to_html();
$plain_text = $doc->to_plain_text();
echo $html;
} else {
echo implode(', ',$doc->get_errors());
}
echo "\n";