php导出doc文件

class Word
{
    public static function save($path, $data)
    {
        $data = "
            <html
                xmlns:o='urn:schemas-microsoft-com:office:office'
                xmlns:w='urn:schemas-microsoft-com:office:word'
                xmlns='http://www.w3.org/TR/REC-html40' >
                <head>
                    <meta charset='utf-8' />
                </head>
                <body>
                    $data
                </body>
            </html>
            ";

        $fp = fopen($path, "wb");
        fwrite($fp, $data);
        fclose($fp);
    }
}