note 30718 added to function.array-diff
| From: | d dot u dot phpnet at holomind dot de | Date: | Wed, 26 Mar 2003 17:48:44 +0000 |
| Subject: | note 30718 added to function.array-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45849@lists.php.net to get a copy of this message | ||
I was not satisfied with the compare-funtions of array_diff() so i wrote a litte diff-clone which
compares arrays and shows all different entries. You can easliy change the function formatline() for
your needs.
function arr_diff( $a1, $a2, $show_matches=0);
...
output:
1 : 1 : - <head><title>Text</title></head>
1 : 1 : + <head><title>Text2</title></head>
4 : 4 : - code b
4 : 4 : + code a
8 : 8 : - code f
See details on: (example and source)
http://www.holomind.de/phpnet/diff.php
http://www.holomind.de/phpnet/diff.src.php
--
http://www.php.net/manual/en/function.array-diff.php
http://master.php.net/manage/user-notes.php?action=edit+30718
http://master.php.net/manage/user-notes.php?action=delete+30718
http://master.php.net/manage/user-notes.php?action=reject+30718