<?php $array1 = [1, 6, 7, 8, 9, 10 ,11]; $array2 = [8, 9, 11]; $array3 = array_diff($array1, $array2); var_dump($array3);
Standard input is empty
array(4) { [0]=> int(1) [1]=> int(6) [2]=> int(7) [5]=> int(10) }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!