实例首页
自学教程
IT工具箱
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>PHP array_diff() 函数 实例 - 自学教程(runoops.com)</title> </head> <body> <?php $a1= ["a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow"]; $a2= ["e"=>"red","f"=>"green","g"=>"purple"]; $a3= ["a"=>"red","b"=>"black","h"=>"yellow"]; $result=array_diff($a1,$a2,$a3); echo '<pre>'; var_dump($result); echo '</pre>'; ?> </body> </html>
运行结果: