drisate Posted October 6, 2009 Share Posted October 6, 2009 Hey guys ... i need help ... I have 2 folders with thousands of mp3 files in each. The names are diffrent but it's the same dame thing inside ... i need to associate 1 to the other in a DB. How can i compare and find matches? Quote Link to comment https://forums.phpfreaks.com/topic/176626-guru-needed-to-help-solve-this/ Share on other sites More sharing options...
MadTechie Posted October 6, 2009 Share Posted October 6, 2009 Your need to index the files with a hash ie $hash = md5_file("a.mp3"); if 2 hashes are the same then the contents is probably the same, Quote Link to comment https://forums.phpfreaks.com/topic/176626-guru-needed-to-help-solve-this/#findComment-931174 Share on other sites More sharing options...
drisate Posted October 6, 2009 Author Share Posted October 6, 2009 Hmm indeed this can work ... Thks bro this was abbout to make something a lot more complicated lol Quote Link to comment https://forums.phpfreaks.com/topic/176626-guru-needed-to-help-solve-this/#findComment-931178 Share on other sites More sharing options...
MadTechie Posted October 6, 2009 Share Posted October 6, 2009 well MD5 will return a 32 character hexadecimal code, which is easier and quicker to deal with than //over kill if(base64_encode(file_get_contents("a.mp3")) == base64_encode(file_get_contents("b.mp3"))) { echo "dup"; } Quote Link to comment https://forums.phpfreaks.com/topic/176626-guru-needed-to-help-solve-this/#findComment-931182 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.