php diff example

UPDATE!

Nils Kappmeier has made a new implementaion of this script.
Less Buggs and Comments but faster ;) so dont forget to check: diff-version2.
The script can also be found in www.pmwiki.org in the module /script/phpdiff.php .

Implementation of DIFF in pure-php

", "Text", "", "code a", "code b", "code c", "code d", "code e", "code g", "", "" ); $f2=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"); print "
";
    print "Input-Data: ";
    print_r( $f1 );
    print_r( $f2 );
    print "";

    print "
Identlical lines hidden:
"; print arr_diff( $f1, $f2 ); print "
Identlical lines shown:
"; print arr_diff( $f1, $f2 ,1); #comparing with array_diff() print "
Compared: array_diff( \$f1, \$f2 );
"; print ""; print_r ( array_diff( $f1, $f2 ) ); print ""; print "
Compared: array_diff( \$f2, \$f1 );
"; print ""; print_r ( array_diff( $f2, $f1 ) ); print ""; print "
"; print "
"; print "© 2007. "; print " view source ."; ?>