开发者

Compare Two PHP Strings

开发者 https://www.devze.com 2023-02-24 10:45 出处:网络
I would like to implement a function that compares 2 strings and displays the different words with a different background (such as green if text is added or red if text is deleted).

I would like to implement a function that compares 2 strings and displays the different words with a different background (such as green if text is added or red if text is deleted).

This function would开发者_运维知识库 be similar to the difference between the original topic and the edited one on StackOverflow.

How would I do this?


I have a pure-PHP implementation here: Text version-control in PHP with difference highlight


You can use already written wdiff

0

精彩评论

暂无评论...
验证码 换一张
取 消