• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>PHP array_udiff() 实例 - 自学教程(runoops.com)</title>
6
</head>
7
<body>
8
​
9
<?php
10
function myfunction($a,$b)
11
{
12
if ($a===$b)
13
{
14
return 0;
15
}
16
return ($a>$b)?1:-1;
17
}
18
​
19
$a1=array("a"=>"red","b"=>"green","c"=>"blue","yellow");
20
$a2=array("A"=>"red","b"=>"GREEN","yellow","black");
21
$a3=array("a"=>"green","b"=>"red","yellow","black");
22
​
23
$result=array_udiff($a1,$a2,$a3,"myfunction");
24
print_r($result);
25
​
26
?>
27
</body>
28
​
29
</html>