title: php max function returns min value from array
body: <p>this is my first post. sorry if i did something wrong...</p>
  
  <p>anyways i have a file that gets updates by php and this is EXACTLY it:</p>
  
  <pre><code>31\n
  127\n
  131\n
  124\n
  144\n
  142\n
  133\n
  133\n
  9\n
  0\n
  22\n
  18\n
  </code></pre>
  
  <p>i made this script in php: </p>
  
  <pre><code>$logContents = file_get_contents("logs/mainlog.txt");
  $logitemArray = explode("\n", $logContents);
  
  echo max($logitemArray);
  </code></pre>
  
  <p>but it echos 9. why? it said in the php documentation that max() should return the biggest value in the array</p>
  
  <p>thanks in advance</p>