Created
July 24, 2016 00:24
-
-
Save matdombrock/830c447206195100f901b4a7d065cfd9 to your computer and use it in GitHub Desktop.
Get command line input for PHP5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function input($ask = "Command"){ | |
$answer = readline($ask.": "); | |
readline_add_history($answer); | |
return $answer; | |
} | |
echo "Welcome \n"; | |
$name = input("What is your name?"); | |
echo "Hello ".$name." \n"; | |
input(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment