Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. array1
  2. array(9130) {
  3.   [0]=>
  4.   array(1) {
  5.     ["id"]=>
  6.     string(5) "16341"
  7.   }
  8.   [1]=>
  9.   array(1) {
  10.     ["id"]=>
  11.     string(5) "16342"
  12.   }
  13.   [2]=>
  14.   array(1) {
  15.     ["id"]=>
  16.     string(5) "16343"
  17.   }
  18.   [3]=>
  19.   array(1) {
  20.     ["id"]=>
  21.     string(5) "16344"
  22.   }
  23.   [4]=>
  24.   array(1) {
  25.     ["id"]=>
  26.     string(5) "16345"
  27.   }
  28.  
  29. сравниваем с такими масивами
  30. type1
  31. array(34) {
  32.   [0]=>
  33.   array(1) {
  34.     ["idM"]=>
  35.     string(5) "52989"
  36.   }
  37.   [1]=>
  38.   array(1) {
  39.     ["idM"]=>
  40.     string(5) "52990"
  41.   }
  42.   [2]=>
  43.   array(1) {
  44.     ["idM"]=>
  45.     string(5) "15229"
  46.   }
  47.  
  48. и
  49. type2
  50. array(34) {
  51.   [0]=>
  52.   array(1) {
  53.     ["idM"]=>
  54.     string(5) "52989"
  55.   }
  56.   [1]=>
  57.   array(1) {
  58.     ["idM"]=>
  59.     string(5) "52990"
  60.   }
  61.   [2]=>
  62.   array(1) {
  63.     ["idM"]=>
  64.     string(5) "15229"
  65.   }
  66.  
  67. $result = array_intersect($array1, $type1, $type2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement