• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>PHP array_intersect() 实例 - 自学教程(runoops.com)</title>
6
</head>
7
<body>
8
​
9
<?php
10
$a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
11
$a2=array("e"=>"red","f"=>"black","g"=>"purple");
12
$a3=array("a"=>"red","b"=>"black","h"=>"yellow");
13
 
14
$result=array_intersect($a1,$a2,$a3);
15
echo '<pre>';
16
print_r($result);
17
echo '</pre>';
18
?>
19
​
20
</body>
21
​
22
</html>