Search This Blog

Tuesday, April 14, 2009

Input from terminal in php i.e without interface

[Input from terminal]
$file = fopen("php://stdin","r");
$dta = fread($file,5); // will take only first 5 char of input
fclose($file);
echo $dta;

No comments:

Post a Comment