title: Making a function with adding up the numbers between a set of numbers
body: <p>I have to make a function that works like this:
  telOp(2, 5) =&gt; 2 + 3 + 4 + 5 = 14
  Or
  telOp(1, 6) =&gt; 1 + 2 + 3 + 4 + 5 + 6 = 21</p>
  <p>I have tried a few things but I can't seem to figure it out. I tried making a while loop in the function:</p>
  <pre><code>&lt;?php
  function telOp($getal1, $getal2){
      while ($getal1 &lt;= $getal2){
          echo $getal1++;
      }
  }
  $resultaat = telOp(5, 10);
  print ($resultaat);
  </code></pre>
  <p>Now this will print the numbers from 5 through 10 but I can't seem to make it work that they add up.</p>
  <p>I have also tried simply adding the numbers up with a return statement but combining the 2 doesn't seem to work.:</p>
  <pre><code>&lt;?php
  function telOp($getal1, $getal2){
      while ($getal1 &lt;= $getal2){
          echo $getal1++;
      }
      $resultaat = ($getal1 + $getal2);
      return $resultaat;
  }
  $resultaat = telOp(5, 10);
  print ($resultaat);
  </code></pre>
  <p>I am new to php so any tips would also be appreciated!</p>