Match patterns in two different arrays

Discussion in 'PHP' started by stuart, Nov 10, 2009.

  1. #1
    Hi

    Does anyone know an easy way to match patterns in two different arrays like so...

    <?php
    // INPUT DATA
    $old_array = array("a", "b", "c", "d", "e", "f", "g", "c");
    $new_array = array("c", "d", "e", "f", "g", "a", "b", "c");
    
    // OUTPUT DATA
    // value [corresponding 'array key' of $old_array]
    // $new_array starts with 'c'... 
    // c [7]
    // d e f [3] [4] [5]
    // g [6]
    // a b c [0] [1] [2]
    ?>
    PHP:
    Many thanks for any help...
     
    stuart, Nov 10, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110