Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP (php 7.3.5) sample

<?php
 
$hi = fopen('php://stdin', "r");
$ho = fopen('php://stdout', "w");
 
while (true) {
	fscanf($hi, "%d", $n);
	if ($n == 42) break;
	fwrite($ho, sprintf("%d
", $n));
}
 
fclose($ho);
fclose($hi);
Source by ideone.com #
 
PREVIOUS NEXT
Tagged: #PHP #sample
ADD COMMENT
Topic
Name
8+8 =