How to compare values in arrays and in case of coincidence to write to check the array?

Help to understand )

There are two-dimensional arrays arr1 and arr2 , you should check if there's a match on the value of array1[$i][3] with arr2[$i][0]
and if there's append to the array array1[$i] the value of arr2[$i][1]
Array
(
 [0] => Array
(
 [0] => a
 [1] => b
 [2] => c
 [3] => 2231
 [4] => some
)

 [1] => Array
(
 [0] => a
 [1] => b
 [2] => c
 [3] => 2344
 [4] => some
)

 [2] => Array
(
 [0] => some
)

)


Array
(
 [0] => Array
(
 [0] => 2231
 [1] => 658
)

 [1] => Array
(
 [0] => 24560
)

)


<?php

$arr1 = array( 
 array('a', 'b', 'c', '2231'),
 array('a' , 'b' , 'c' , '2344')
);

$arr2 = array(
 array('2231', '658'),
 array('2456' . '0')
);

$size_arr2 = count($arr2);


$size = count($arr1);

for ($i = 0; $i <= $size; $i++) {

 $arr1[$i][] = 'some';

} 


print_r($arr1);</code-->
June 14th 19 at 21:04
1 answer
June 14th 19 at 21:06

Find more questions by tags PHP