I need to check if there is a new version of a photos... first, i need the photo locally. But when the photo is copy locally, the user can update the photo on his server, and i need to check it the photo have change
here is the code
$file1 = file_get_contents($path_photo);
$str1 = strlen($file1);
$file2 = file_get_contents($complete_photo_name);
$str2 = strlen($file2);
if (($str1 == $str2) == false){ <code to take the file on the remote server and copy locally on my server !>}
this code take 9 second for 20 photos.... there should be a faster way to check if two file are the same...both is picture, but maybe there is a new version on the remote server...if there is a new version i need to copy it locally to my server.
p.s i cannot use date, because the date of the photo create locally is never the same as the photo on the remote server !
MORE NOTES : The photos cannot be hotlink to the remote server it must be link locally remote server = somewhere local server = server that execute the code of the web page !
even with md5, it take as much time as copy ans save all the image... what i what is copy only CHANGE images !
NOTE to : This question already has an answer here: It's have NOT been answer... no good or accepted answer... all take too long !