title: Compare difference between comma separated strings
body: <p>I have 2 strings and i'd like to compare the difference and use the values of those items that are different. For example:</p>
  
  <pre><code>$stringA = "1, 2, 3, 4, 5"
  $stringB = "1, 2, 4, 5, 6"
  </code></pre>
  
  <p>So the difference with stringB is that the '3' is missing and '6' is added.</p>
  
  <p>I'd like to perform a function that uses the values '3' and '6'. To put this in context, imagine the strings are used in a MySQL query where I want to update only the records with id 3 and 6 as they have changed so need updating but the rest remain the same so no need to update the database records for those. I hope that makes sense?</p>
  
  <p>How would I get the differences using PHP and ensure the result is again a string with comma separated values? i.e</p>
  
  <pre><code>$stringDifference = "3, 6"
  </code></pre>