PHP code example of lyseontech / doctotext

1. Go to this page and download the library: Download lyseontech/doctotext library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lyseontech / doctotext example snippets




use DocToText\DocToText;

$docFile = 'document.doc';
$outputDir = '/tmp';
$doctotext = new DocToText($docFile, $outputDir));
echo "Text:" . PHP_EOL;
echo $doctotext->getText();
echo "Total words:" . PHP_EOL;
echo $doctotext->count();