I'm trying to compare two arrays using this code:
$diff = array_diff($selected, $checkboxes);
echo '<br>selected:';
print_r($selected);
echo '<br>original:';
print_r($checkboxes);
echo '<br>difference:';
print_r($diff);
The strange thing is though this results in the following:
selected:Array ( [0] => Forum1 [1] => Forum3 [2] => Furniture )
original:Array ( [0] => Forum1 [1] => Forum3 [2] => forum4 [3] => Furniture [4] => Nieuwforum )
difference:Array ( [0] => Forum1 [1] => Forum3 [2] => Furniture )
It seems like the array_diff function only copies the 'selected'array. I tried several things that where posted in similar question like for instance using array_diff_assoc but it doesn't matter.
Anyone knows what goes wrong?