doukezi4576 2009-04-10 05:09
浏览 189

如何使用PHP进行文本DIFF?

What is the best way to do this for PHP? Is there any PHP function that can do this, considering the column content could be very large?

If PHP function is not available, what shell utility can I call?

thanks

  • 写回答

3条回答 默认 最新

  • dongsong1911 2009-04-10 05:11
    关注

    The usual process is to store each distinct revision and calculate the diff when the user wants to view it, perhaps caching that output if the process is expensive.

    You could store a base revision, and then have a set of diffs which can be applied to obtain previous versions.

    In either case, there's a concession to be made; the first option makes retrieving specific versions inexpensive, at the cost of a little more processing required for diffing; the second makes diff viewing cheap, but at the cost of potentially expensive incremental patching to obtain a specific version.

    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)