how do i compare 2 html pages, and output only the different bits in ruby or PHP?

前端 未结 3 919
心在旅途
心在旅途 2021-01-29 08:32

how can i get 2 pages, and output the difference between those. getting the pages not a problem, but stuck on how to get the difference....i need a library for ruby OR php

相关标签:
3条回答
  • 2021-01-29 08:33

    http://us3.php.net/manual/en/function.xdiff-string-diff.php

    0 讨论(0)
  • 2021-01-29 08:41

    Not exactly what you asked for, but you might find it interesting and/or useful, but there is a Javascript diff library which might work for your needs.

    0 讨论(0)
  • 2021-01-29 08:45

    For PHP, I'd suggest looking at the daisydiff project. This work was done to create a visual diff for Mediawiki.

    Otherwise, the easiest thing to do would be to shell out to the diff program, and transform the results into html.

    0 讨论(0)
提交回复
热议问题