$filename = iconv("UTF-8", "GBK", $filename); $files = array($filename); $logdate = $rl->getLogDate($files[0]); $title = 'Nginx日志统计 ' . $logdate; $html = <<<HTML <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{$title}</title> </head> <style type="text/css"> body {font-size: 12px; font-family: Arial, Helvetica, sans-serif; } table#dd {background-color: #6CADD9;white-space:nowrap;} table#dd thead th {background-color: #6CADD9;color: #FFFFFF;font-size: 12px;} table#dd td {padding: 6px;width: 120px;} table#dd tbody.tb1 td {background-color: #FFFFFF;} table#dd tbody.tb2 td {background-color: #F7F7F7;} table#dd tbody td:hover {background-color: #BFEDF9;} table#dd tbody td ul {list-style-type:none;margin:0px;padding:0px;} center {font-size: 24px;margin:50px} </style> <body> <center>{$title}</center> HTML; $s = time(); $arr = $rl->getContentFromFile($files); ksort($arr); $html .= $rl->arrayToTable($arr); $html .= '</body></html>'; echo $html; //sendMail ( $title, $html );