- print_r: documentation ( source)
- array_diff: documentation ( source)
<?php
$existing = array(1,2,3,4);
$onForm = array(3,4,5,6);
$removed = array_diff($existing,$onForm);
$new = array_diff($onForm,$existing);
echo 'existing';
print_r($existing);
echo 'form';
print_r($onForm);
echo 'removed';
print_r($removed);
echo 'new';
print_r($new);