redirect('@admin/login'); } public function test() { $str=file_get_contents('https://lidadz.hdlkeji.com/store/contract/mb'); $mpdf=new Mpdf(['mode'=>'utf-8','format' => 'A4']); $mpdf->SetDisplayMode('fullpage'); //自动分析录入内容字体 $mpdf->autoScriptToLang = true; $mpdf->autoLangToFont = true; $fileUrl = "upload/test/test.pdf"; $mpdf->WriteHTML($str); $mpdf->Output($fileUrl); $url= 'https://lidadz.hdlkeji.com/mb.html'; $content = file_get_contents($url); $fileContent = getWordDocument($content,"https://www.jb51.net/Music/etc/"); $fp = fopen("test.doc", 'w'); fwrite($fp, $fileContent); fclose($fp); } }