Is it possible to open and manipulate Word .doc files using PHP?

Yes, it is possible to open and manipulate Word .doc files using PHP. One way to achieve this is by using the PHPWord library, which allows you to create, read, and write Word documents directly from PHP. You can use this library to open existing .doc files, modify their contents, and save them back to the file system.

// Include the PHPWord library
require_once 'PHPWord/src/PhpWord/Autoloader.php';

// Create a new PHPWord object
$phpWord = new PhpOffice\PhpWord\PhpWord();

// Load an existing Word document
$phpWord = \PhpOffice\PhpWord\IOFactory::load('path/to/your/document.doc');

// Get the document properties
$properties = $phpWord->getProperties();

// Output the document properties
echo 'Title: ' . $properties->getTitle() . '<br>';
echo 'Subject: ' . $properties->getSubject() . '<br>';
echo 'Creator: ' . $properties->getCreator() . '<br>';