代码

class PHPWord{
    public $content = '';
    public function add($data){
        $this->content .= $data;
        return $this;
    }

    public function get(){
        return $this->content();
    }

    public function file($path){}

    private function content(){
        $html = '<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">';
        $html .= $this->content;
        $html .= '</html>';
        $this->content = '';
        return $html;
    }
}