I am Having Two array like the following ,
$a =array(1,2,3,4);
$b =array(1,2,5,6);
here is mycode
$c=array_diff($a,$b);
$c=array(3,4,5,6);
but i want it like the following
$c=array(3,4);
Note:
i want $a array value which is not present in $b array.
array_diff()should do exactly what you want. It works for me - codepad.viper-7.com/tMTzzG$c=array_diff($b,$a);$bthat are not present in$a.$c=array(3,4,5,6);