<?php
$a = array('John', 'Bob', 'Mary', 'Serena');
$b = array('Jim', 'Mary', 'John', 'Bob');


$a = array_unique($a);
$b = array_unique($b);


$a_minus_b = array_diff($a, $b);
$b_minus_a = array_diff($b, $a);


$symmetric_difference = array_merge($a_minus_b, $b_minus_a);


echo 'List A:               ', implode(', ', $a),
   , implode(', ', $b),
  , implode(', ', $a_minus_b),
  , implode(', ', $b_minus_a),
   , implode(', ', $symmetric_difference), ;
?>