Implementation of DIFF in pure-php

this outputs the difference in gnu diff(1) syntax.
", "Text", "", "code a", "code b", "code c", "code d", "code e", "code g", "", "" ); $f2_arr=Array( "", "Text2", "", "code a", "code a", "code c", "code d", "code e", "code g", "code f", "", "" ); #you can use files as input and compare them # simply with, this gives you simple diff in your webserver. # # $f3= file ("path to file"); $f1 = implode( "\n", $f1_arr ); $f2 = implode( "\n", $f2_arr ); print "
";
    print "Input-Data: ";
    print_r( $f1_arr );
    print_r( $f2_arr );
    print "";

    print "
new, old
"; print PHPDiff( $f1, $f2 ); print "
old, new
"; print PHPDiff( $f2, $f1 ); #comparing with array_diff() print "
Compared: array_diff( \$f1_arr, \$f2_arr );
"; print ""; print_r ( array_diff( $f1_arr, $f2_arr ) ); print ""; print "
Compared: array_diff( \$f2_arr, \$f1_arr );
"; print ""; print_r ( array_diff( $f2_arr, $f1_arr ) ); print ""; print "
"; print "
"; print "© 2003-2006 ."; print " view source ."; ?>