Maison >développement back-end >tutoriel php >php基础练习--目录操作_PHP教程
php基础练习--目录遍历:
("content-type:text/html;charset=utf-8" = "./final/factapplication" listdir( = ( ( !== ( = ( = .'/'. ( != '.' && != '..' (( ."核心:递归的经典应用,以及文件和目录的基本操作。
= "../fileupload" = "b" copydir(, ( = ( ( !== ( = ( = ."/". = ."/". ( != "." && != ".." ((, (, (, ); copydir核心:copy函数。
= 'a' deldir( = ( ( !== ( = ( = .'/'.( != '.' && != '..' (((( (); deldir核心:注意unlink删除的是带path的file。
= "a" dirsize( = ( ( !== ( = ( = .'/'. ( != '.' && != '..'(( = + ( ( dirsize(); dirsize核心:通过判断$tot在哪里返回,理解递归函数。