Compare two stings and highlight the dufference

  compare, html, php

I want to compare two strings ind php:

$a = "Hello world;
$b = "Hello world.";

and display $b and highlight the difference between $a and $b (with a green color in html) like:

Hello world .

Can you help?

Source: Ask PHP

LEAVE A COMMENT