Re: compare text with diff

Stefan <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
>
>
>   


-------------------------------------------------------------------------
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.