php recursive directory creation

$filename = ''2018/4/18;

function mk($filename){

return is_dir($filename) OR  mk(dirname($filename)) AND mkdir($filename);

}

is_dir() Determines whether the directory exists and stops executing to the right. Otherwise continue to the right.

OR takes precedence over AND


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325913435&siteId=291194637