title: Get the minimum value of array with the following code
body: <p>I don't really understand the logic of the following:</p>
  
  <pre><code>$max = array_reduce($values, function($max, $i) {
      if (is_numeric($i) &amp;&amp; $i &gt; $max) {
          return $i;
          //echo $i."max";
      }
      return $max;
  
  });
  </code></pre>
  
  <p>This will return the maximum value in array. How I can modify the above code to return the minimum value as long is numeric? This will help me understanding how this works. i am aware or min and max functions.
  Thanks in advance </p>