解决方法两个:
1.借用替换函数。如:
str_replace("\\","/",dirname(__FILE__));
2.使用变量,DIRECTORY_SEPARATOR。如:
$today = date('Y-m-d');
$dir = storage_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'requestLog'.DIRECTORY_SEPARATOR.$today;
if(!is_dir($dir)){
mkdir($dir);
}