Is there any way for php to highlight the difference between two strings? -


I have a table that has two mySQL records, one original and one that has been edited and for acceptance / rejection The flag is flagged by the administrator I want to change the column color to highlight the rows that have been edited.

The color highlighting on the changing lines works for all the rows except "Pay" and "Email", for some reason they are always different even when the values ​​look completely identical.

Does PHP have a function that highlights the difference between the two strings, so I know where the difference is?

Here my code is for one line:

   & Lt; Td> & Lt ;? Php htmlout ($ flagged [[salaryfrom ']. ""); ? & Gt; & Lt; / TD & gt; & Lt; / TR & gt; Function htmlval ($ text) {return html_entity_decode ($ text, ENT_QUOTES); }    

Use it

  & lt; Php if ($ cand ['salaryfrom']! = $ Flagged ['from salary']) $ tcolor = "# 000000"; Else $ tcolor = "# D3D5E8"; ? & Gt; & Lt; Td style = "background: & lt ;? php echo $ tcolor;? & Gt;; & gt; & lt; b & gt; by pay & lt; / b & gt; & lt; / td & gt; & lt ; Td> 
Php echo $ flaggedcand ['salaryfrom']. "";? & Gt; & lt; / td & gt;

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -