Jump to content

[SOLVED] Function usage question


acctman

Recommended Posts

to call the function below, i include the file at the top and then use usr_delete_dir() but do I have to include $usrdir = '/temp/'; or do i put usr_delete_dir('/temp/');

 

function usr_delete_dir($usrdir) {
    if (is_dir($usrdir))
        $dir_handle = opendir($usrdir);
    if (!$dir_handle)
        return false;
    while($file = readdir($dir_handle)) {
        if ($file != "." && $file != "..") {
            if (!is_dir($usrdir."/".$file))
                unlink($usrdir."/".$file);
            else
                delete_directory($usrdir.'/'.$file);           
        }
    }
    closedir($dir_handle);
    rmdir($usrdir);
    return true;
}

Link to comment
https://forums.phpfreaks.com/topic/146289-solved-function-usage-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.