Re: If I have 2 arrays...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Jay,

Thursday, June 16, 2005, 5:54:40 PM, you wrote:

JB> ...shouldn't array_intersect($arr1, $arr2) return an array?

Works perfectly for me (code below)
PHP 4.3.11

<?php
        $array1 = array('ORIGTN', 'PSP_BILL1', 'PSP_BILL2', 'PSP_BILL3', 'PSP_CITY', 'PSP_STATE', 'PSP_ZIP', 'PSP_CONNECT', 'STATUS', '_0404', '_0405', '_0406', 'Total', 'Rate', 'Total Comp');

        $array2 = array('PSP_BILL1', 'PSP_BILL3', 'PSP_CITY', 'PSP_STATE', 'PSP_ZIP', 'TOTAL COMP');

        $array3 = array_intersect($array1, $array2);

        print_r($array1);
        print_r($array2);
        print_r($array3);
?>

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux