• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

[PHP] Help me to find md5 hash for a directory

Subhash

New Member
Can any one help me to find the md5 hash for a whole directory. I want this to make a automatic backup program in php.
Plz help me, If you can write a function to do that then it will be better.
:confused4
 
Something like this

PHP:
function MD5Dir($dir) {

    $dir2 = opendir($dir);
        
    $files = readdir($dir2);

   closedir($dir2);

    $return = md5($files);

return $return;

}

thats the concept i have, will it work for your needs, who knows

I DON'T GUARENTEE THIS CODE TO WORK AS IT IS UNTESTED
 
Thank's for your effort.
But I think this will not take the md5 hash of the file contents, not also proceeds the subdirectories and does't has any option to work on directory structure.
However I manged to created a function in which it takes the hash of directory names, file names, proceed to subdirectories, includes hash of every file contents and holds the whole directory and file structure.

But yours one is also good, thanks for your concern.
 
Back
Top