note 19940 added to function.md5-file
| From: | dpiper at stens dot com | Date: | Fri, 15 Mar 2002 19:53:51 +0000 |
| Subject: | note 19940 added to function.md5-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27841@lists.php.net to get a copy of this message | ||
Since I am running PHP4.1.2 and the md5_file is not included yet in the source code, here is a
binary safe PHP-code function to do the same thing if anyone else wants it:
This function is:
function md5_of_file($inFile) {
if (file_exists($inFile)) {
$fd = fopen($inFile, 'r');
$fileContents = fread($fd, filesize($inFile));
fclose ($fd);
return md5($fileContents);
} else {
return false;
}
}
--
http://www.php.net/manual/en/function.md5-file.php
http://master.php.net/manage/user-notes.php?action=edit+19940
http://master.php.net/manage/user-notes.php?action=delete+19940
http://master.php.net/manage/user-notes.php?action=reject+19940