arraydiffexample - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of arraydiffexample.php

  1. <?php
  2.  
  3. $a = [
  4.     ['id' => 1],
  5.     ['id' => 2],    
  6.     ['id' => 3],    
  7.     ['id' => 4],    
  8.     ['id' => 5],    
  9.     ['id' => 6],    
  10. ];
  11.  
  12. $b = [
  13.     ['id' => 2],    
  14.     ['id' => 5],    
  15.     ['id' => 6],    
  16. ];
  17.  
  18.  
  19. var_dump(array_diff($a, $b));
File Description
  • arraydiffexample
  • PHP Code
  • 19 Nov-2019
  • 244 Bytes
You can Share it: