title: PHP array input with single spaces not in new line
body: <p>I am new in PHP. I want to take input of an array from user in a single line with single white spaces<br>
  like <code>5 6 2 1 4</code> but my code is taking inputs like  </p>
  
  <pre><code>5  
  6  
  2  
  1  
  4 
  </code></pre>
  
  <p>and then it is giving desired output.
   Here is my code-</p>
  
  <pre><code> &lt;?php 
      $fp = fopen("php://stdin", "r");  
      fscanf($fp, "%d", $m);  
      $ar = array();` 
      for ($i=0; $i&lt;$m; $i++) {
          fscanf($fp, "%d ", $ar[$i]);
      }  
      ?&gt;
  </code></pre>
  
  <p>Please Help me.<br>
  <a href="https://www.hackerrank.com/challenges/quicksort1" rel="nofollow">Here is the problem I want so solve</a></p>