title: PHP Array and self math
body: <p>My question is how to do a comparison function on an array of integers in PHP?</p>
  
  <p>Specifically, I start with an array I want to filter:</p>
  
  <pre><code>$array = array(1,10,18,29,42,50,61);
  </code></pre>
  
  <p>and return an array that looks like this:</p>
  
  <pre><code>//return where diff &gt; 10
  $new_array = array(1,29,42,61);
  </code></pre>
  
  <p>I'm trying to ensure that I filter out any numbers where the difference is less than 10, including any adjacent numbers (hence why 18 is not in the list).</p>