The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Intersection of arrays
#1
How can I get intersection of arrays?

ex.

array a(i j)
[0 0]=John
[1 0]=value1
[0 1]=Mike
[1 1]=value11
[0 2]=Lisa
[1 2]=value111

array b(i j)=
[0 0]=Mike
[1 0]=value2
[0 1]=Peter
[1 1]=value22
[0 2]=John
[1 2]=value222

array c(i j)=
[0 0]=Sophie
[1 0]=value3
[0 1]=Lisa
[1 1]=value333


=

array intersection(a b c)=

[0 0]=John
[1 0]=value1
[2 0]=value222
[3 0]=
[0 1]=Lisa
[1 1]=value111
[2 1]=
[3 1]=value333
[0 2]=Mike
[1 2]=value11
[2 2]=value2
[3 2]=
[0 3]=Peter
[1 3]=
[2 3]=value22
[3 3]=
[0 4]=Sophie
[1 4]=
[2 4]=
[3 4]=value3


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)