Библиотека сравнения строк Horde_Text_Diff сравнивает только первый символ строкPhp

Кемеровские программисты php общаются здесь
Anonymous
Библиотека сравнения строк Horde_Text_Diff сравнивает только первый символ строк

Сообщение Anonymous »


I am using Horde_Text_Diff to compute the difference between two strings. Sample code is as follows:

$check_diff = new Horde_Text_Diff( 'auto', array('asdf','asd11') ); $renderer = new Horde_Text_Diff_Renderer_Inline(); echo $renderer->render($check_diff); This echoes nothing. The correct behaviour would be to show a difference at character 4.

If I change the comparison array from array('asdf','asd11') to, for instance, array('asdf','12345'), then it will output a1. In other words, it seems only to be comparing the first character. Any ideas?


Источник: https://stackoverflow.com/questions/181 ... -of-string

Вернуться в «Php»