text1 = $text1 ; $this->text2 = $text2 ; $left_lines = explode("\n", $this->text1); $right_lines = explode("\n", $this->text2); $this->text_diff = new Text_Diff($left_lines, $right_lines); } /**==================================================================================================================================================== * Displays a human readable HTML representation of ALL the text marked with differences . * * @return string HTML with differences. */ public function show_all_with_difference() { $renderer = new Text_Diff_Renderer_inline() ; $result = $renderer->render($this->text_diff) ; $lignes = explode("\n", $result) ; $del_continue = false ; $ins_continue = false ; $return = "
" ;
if ($del_continue)
$return .= "" ;
if ($ins_continue)
$return .= "" ;
if (substr_count($l, '')-substr_count($l, '') > 0)
$del_continue = true ;
if (substr_count($l, '')-substr_count($l, '') < 0)
$del_continue = false ;
if (substr_count($l, '')-substr_count($l, '') > 0)
$ins_continue = true ;
if (substr_count($l, '')-substr_count($l, '') < 0)
$ins_continue = false ;
$l = str_replace("", "", $l) ;
$l = str_replace("", "", $l) ;
$l = str_replace("", "", $l) ;
$l = str_replace("", "", $l) ;
$return .= $l ;
if ($del_continue)
$return .= "" ;
if ($ins_continue)
$return .= "" ;
$return .= "".$buffer[$i][1]."\n" ; $troispoint = false ; } else { if (!$troispoint) { if ($first_trois_points) { $return .= "
...\n" ; $next_points .="
...\n" ; $next_points .= "
..." ; $next_points .="