function xmsb_writelog($data, $fileName)
{
$month = date('Y-m');
$day = date('d');
dir_name = './log/'.month.'/';
$path = $dir_name . $fileName . '_' . $day . '_request_log.txt';
// 检测目录是否存在,若不存在则进行创建
if(!file_exists($dir_name))
{
$res = mkdir(iconv('UTF-8', 'GBK', $dir_name), 0777, true);
}
// 以写入方式打开文件
fp = fopen(path, 'a');
// 定义写入内容
$time = '['.date('Y-m-d H:i:s').'] ';
text = var_export(data, true);
// 写入并关闭文件
fwrite($fp, time.text."\r\n");
fclose($fp);
}