ulvis.paste.net

Paste Search Dynamic
Recent pastes
fscanf
  1. <?php
  2.  
  3. $hi = fopen('php://stdin', "r");
  4. $ho = fopen('php://stdout', "w");
  5.  
  6. while (true) {
  7.         fscanf($hi, "%d", $n);
  8.         if ($n == 42) break;
  9.         fwrite($ho, sprintf("%d\n", $n));
  10. }
  11.  
  12. fclose($ho);
  13. fclose($hi);
Parsed in 0.010 seconds