Jump to content

md5_file question


darkcarnival

Recommended Posts

hi,

I'm interested in using the md5_file function as a way to check for a new verison of a script of mine.

currently i have a variable setup that i check but thats too much hassle when i have to update it for bug releases.

this md5_file function looks like something that would easier for me to check, if im wrong let me know.

now i checked on the php official site, but they dont give much detail on it so I'm hoping someone here knows a bit more about the workings of that function.

much thanks :)
Link to comment
https://forums.phpfreaks.com/topic/23361-md5_file-question/
Share on other sites

Something like this should solve your problem.

[code]<?php
$old = "the old hash would in some way be stored in this variable";

if(md5_file("http://example.com/the_file.tar.gz") === $old)
{
echo "A new version has been released";
}
else {
echo "No updates are available";
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/23361-md5_file-question/#findComment-105925
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.