Skip to content

Instantly share code, notes, and snippets.

@shyuan
Created August 27, 2018 09:57
Show Gist options
  • Save shyuan/3a36fd9aecf8a7ecef4a6495db9308d5 to your computer and use it in GitHub Desktop.
Save shyuan/3a36fd9aecf8a7ecef4a6495db9308d5 to your computer and use it in GitHub Desktop.
PHP Array Diff
<?php
$array1 = array(1,2,3,4,5,6,7);
$array2 = array(5,6,7,8,9,10);
var_dump(array_diff($array1, $array2));
var_dump(array_diff($array2, $array1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment