note 27687 modified in function.md5-file by tix

From: Date: Mon, 16 Dec 2002 07:08:31 +0000
Subject: note 27687 modified in function.md5-file by tix
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40945@lists.php.net to get a copy of this message
==== function md5_f($file) { $fp = @fopen($file,"r"); if(is_resource($fp)) { while(!feof($fp)) { $con .= fread($fp,512); } fclose($fp); $con = md5($con); } return (!isset($con))?FALSE:$con; } ==== works for local or offsite files ~Raistlin --was-- ==== function md5_f($file) { $fp = @fopen($file,"r"); if(is_resource($fp)) { while(!feof($fp)) { $con .= fread($fp,512); } fclose($fp); $con = md5($con); } return (!isset($con))?FALSE:$con; } ==== correction, I seem to have forgotten an "!" when typing it out, not the best way to give help, to get it wrong. Sorry ~Raistlin http://www.php.net/manual/en/function.md5-file.php

« previous php.notes (#40945) next »