After some try and error it works as follows
//$old = array with one line of text in each array element
$old=array("abcd","defg","zzz");
//$new = array with one line of text in each array element
$new=array("abcd","decg","zzz");
$pagedata = HTML(array());
require_once('lib/diff.php');
$diff = new Diff($old, $new);
$fmt = new HtmlUnifiedDiffFormatter;
$pagedata->pushContent($fmt->format($diff));
return HTML($pagedata);
Thats only for information
Stefan schrieb:
> hello,
>
> can someone tell me how i can use difflib.php the internal phpwiki diff
> library to compare two kind of text. I need something like
>
> wiki_result_page_in_diff_style = diff($text1,$text2)
>
> whould be happy if someone could help
>
> Stefan
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Phpwiki-talk mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
>
>
>
|