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