title: Swapping highest and lowest values in a single array - PHP
body: <p>I'm new to PHP. A friend was helping me learn this, but he's not available for a while. I know some things may simply not make sense (i'm learning, and I know this isn't exactly a beginners function).</p>
  
  <p>GOAL:
  1. Find highest and lowest value within the array ($lemons).
  2. Switch the placement of said values. (IE: 6, 2, 7, 8, 0, 9 --> 6, 2, 7, 8, 9, 0).</p>
  
  <h2>Thanks!</h2>
  
  <pre><code> &lt;?php
   function switcheroo($lemons) {
      $min_lemons = min($lemons);
      $max_lemons = max($lemons);
      foreach ($lemons as $key =&gt; $value) {
          if ($max_lemons &gt; 0) {
              $max_decoy = $min_lemons;
          }
          if ($min_lemons &lt; 0) {
              $min_decoy = $max_lemons;
          }
      }
      return $lemons;
   }
   $lemons = array(6, 2, 7, 8, 0, 9);
   print_r(switcheroo($lemons));
   ?&gt;
  </code></pre>