Re: scanf function

By xxxy, 6 Years ago (2012-11-22 02:25:55), written in PHP, viewed 481 times. This paste is a reply to scanf function by Crys
URL https://paste.godclan.hu/view/abRnQIJM Embed
Download Paste or View RawExpand paste to full width of browser
  1. <?php
  2. function scanf($format) {
  3.     $trace = debug_backtrace();
  4.     $args = $trace[0]['args'];
  5.     $argc = func_num_args();
  6.     $inputs = fscanf(STDIN, $format);
  7.         $n = count($inputs);
  8.         if($argc <= $n)
  9.         $n = $argc - 1;
  10.         for($i=0;$i<$n;$i++)
  11.         $args[$i+1] = $inputs[$i];
  12.         return $n;
  13. }
  14.  
  15. scanf("%d", &$number);
  16.  
  17. echo $number;
  18. ?>

Replies to Re: scanf function rss

Title Name When
Re: Re: scanf function Crys 6 Years ago.

Reply to "Re: scanf function"

Here you can reply to the paste above