Home >Backend Development >PHP Tutorial >PHP basic exercises--directory operations_PHP tutorial
php basic exercises - directory traversal:
("content-type:text/html;charset=utf-8" = "./final/factapplication" listdir( = ( ( !== ( = ( = .'/'. ( != '.' && != '..' (( ."Core: Classic applications of recursion, as well as basic operations on files and directories.
= "../fileupload" = "b" copydir(, ( = ( ( !== ( = ( = ."/". = ."/". ( != "." && != ".." ((, (, (, ); copydirCore: copy function.
= 'a' deldir( = ( ( !== ( = ( = .'/'.( != '.' && != '..' (((( (); deldirCore: Note that unlink deletes the file with path.
= "a" dirsize( = ( ( !== ( = ( = .'/'. ( != '.' && != '..'(( = + ( ( dirsize(); dirsizeCore: Understand recursive functions by determining where $tot returns.