Skip to content

Instantly share code, notes, and snippets.

@GXTX
Created October 30, 2012 18:49
Show Gist options
  • Save GXTX/3982210 to your computer and use it in GitHub Desktop.
Save GXTX/3982210 to your computer and use it in GitHub Desktop.
<?php
print "Please enter a number: ";
$stdin = fopen ("php://stdin","r");
$input = trim(fgets($stdin));
if(is_numeric($input)){
$output = "*";
for($i = 0; $i < $input; $i++){
print $output."\n";
$output .= "*";
}
}
else{
print "Unrecognized.\n";
}
die();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment