i want to save a post from an html form into a msword file
<form method="post" action="process.php">
<text name="comment"></text>
<input type="submit" name="send" value="submit"/>
</form>
process.php
<?php
if(isset($_POST['submit']))
{
$body=$_POST['comment'];
$newfile = fopen("essay/last.docx", "w") ;
$content = "$body";
fwrite($newfile, $content);
fclose($newfile);
}
?>
the created file is not a valid msword file. any help is appreciated