a working example of the usage of this function, to confirm a specific file has not been modified (replace all instances of "myfile.xxx" with your filename):
<?php
$chkfilename = "myfile.xxx";
$chkmd5return = md5_file($chkfilename);
if ($chkmd5return != "myfile.xxx's md5 value") {
echo "You have replaced myfile.xxx with an unknown version of the file, please replace the original file.";
} else {
(your code to be executed, now that it has confirmed your myfile.xxx has been unmodified)
}
?>
To find out the file's md5 value, create a new .php doc, and put this code in it:
<?php
$chkfilename = "myfile.xxx";
$chkmd5return = md5_file($chkfilename);
echo $chkmd5return;
?>
Then upload the new .php doc to your webserver and navigate to it. Be sure to delete the new .php doc once you have plugged in the value it spits out, into the "myfile.xxx's md5 value" in the first example above.
I just thought this example might be helpful to someone somewhere... if you php.net people feel it needs editing or deletion, I leave it to your discretion. ;)