The Little Guy Posted July 20, 2011 Share Posted July 20, 2011 What would be a good way to do a version comparison, like how Wikipedia does it? Quote Link to comment https://forums.phpfreaks.com/topic/242474-version-compare/ Share on other sites More sharing options...
requinix Posted July 20, 2011 Share Posted July 20, 2011 The best way would be to outsource the problem to something like Unix's diff (which undoubtedly has ports for other operating systems). Create two temporary files (if they aren't files already), run them through diff, and parse the output. If you need to do it yourself then you should get familiar with the longest common subsequence algorithm. Quote Link to comment https://forums.phpfreaks.com/topic/242474-version-compare/#findComment-1245347 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.