Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. function myfunction($a,$b){
  2.  
  3. if ($a===$b){
  4.  
  5. return 0;
  6.  
  7. }
  8.  
  9. return ($a>$b)?1:-1;
  10. }
  11.  
  12.  
  13.  
  14. $a1 = array("a"=>"red","b"=>"green","c"=>"blue");
  15.  
  16. $a2 = array("d"=>"red","b"=>"green","e"=>"blue");
  17.  
  18. $result = array_diff_uassoc($a1,$a2,"myfunction");
  19.  
  20. print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement