PHP: visual difference between 2 arrays

Posted by Paulo Freitas on Stack Overflow See other posts from Stack Overflow or by Paulo Freitas
Published on 2010-03-12T00:55:10Z Indexed on 2010/03/12 0:57 UTC
Read the original article Hit count: 246

Filed under:
|
|

I've these arrays:

<?php

// New
$array1 = array(
    array(
        'g_id' => '1',
        'g_title' => 'Root Admin',
        'g_perm_id' => '1',
        'g_bitoptions' => '0'
    ),
    array(
        'g_id' => '2',
        'g_title' => 'Member',
        'g_perm_id' => '2',
        'g_bitoptions' => '32'
    ),
    array(
        'g_id' => '3',
        'g_title' => 'Banned',
        'g_perm_id' => '3',
        'g_bitoptions' => '0'
    )
);

// Old
$array2 = array(
    array(
        'g_id' => '1',
        'g_title' => 'Admin',
        'g_perm_id' => '1',
        'g_bitoptions' => '0'
    ),
    array(
        'g_id' => '2',
        'g_title' => 'User',
        'g_perm_id' => '2',
        'g_bitoptions' => '0'
    ),
    array(
        'g_id' => '4',
        'g_title' => 'Validating',
        'g_perm_id' => '4',
        'g_bitoptions' => '0'
    )
);

What I'm want is an HTML visual difference between them, like this picture: http://img519.imageshack.us/i/diffe.png/

Anyone here knows any 3rd party class that do this? I've been looking at some but none of them had it. =/

Thank you in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about array