I have 2 txt files. I am processing the file number 1 is obtained multidimensional array print_r($columns) :

 [0] => Array ( [0] => 1010111 [1] => 56102999001 [2] => 000 [3] => 10101000000000916001 [4] => ДА [5] => 4204920.71 [6] => 4204920.71 [7] => КАССА [8] => [9] => 03.10.2011 [10] => [11] => 202613789 [12] => [13] => [14] => вал [15] => [16] => 00 ) 

then I take file # 2 and also process: it turns out print_r($stre) :

 Array ( [0] => 0001300002 [1] => 1 [2] => 1 [3] => 06 [4] => [5] => 000 [6] => 56102999001 [7] => 29803999001 [8] => 147862.00 [9] => 147862.00 [10] => [11] => [12] => 03.10.2011) 

I need to compare the file array number 1 and number 2. in No. 1, you need to compare the array [1] with No. 2 arrays [6] and [7] and to output all the information from the No. 2 file where the accounts coincide! it doesn't matter either [6] or [7] from [1] from the first file.

  • And where is the "problem with comparing arrays"? In the text, this is not a question, but a statement of the problem. - KiTE
  • How can I compare these arrays and display the information on the account? - chambo

1 answer 1

Using foreach($array as $key => $value) run over the first array and compare the values ​​with the corresponding keys. Then you can also run through the second array if you need a difference. If you just need the fact of difference, it is enough to know that when you first check there are no differences and the sizes of the arrays are the same.