title: PHP read numbers from a txt file
body: <p>i'm having some troubles trying to read foat numbers from a txt file.
  The txt file is this:</p>
  
  <pre><code>10.4 20.5 30.1 40.33 50.12
  60.56
  </code></pre>
  
  <p>i need to store these number in an array, this is the php code that i'm using:</p>
  
  <pre><code>$result = array();
  $fp = fopen("./test.txt", "r");
  fscanf($fp, "%d\n", $count);
  $numbers = explode(" ", trim(fgets($fp)));
  foreach ($numbers as &amp;$number)
  {
      $number = floatval($number);
      array_push($result,$number);
      echo $php_errormsg;
  }
  fclose($fp);
  </code></pre>
  
  <p>But i only get one number, the last one, i tried many ways but i can't solve it by myself at the moment, can anyone help me?</p>