Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function clearCMD($clear)
- {
- if(PHP_OS =="Linux")
- {
- $clear = exec("clear");
- print($clear);
- }
- else
- {
- $clear = exec("cls");
- print($clear);
- }
- }
- clearCMD();
- function typeWords()
- {
- $catchWords = print "Bonjour ! Bienvenue sur le 'PHP Hangman' !\nVeuillez saisir votre mot :\n";
- $fp = fopen('php://stdin', 'r');
- $last_line = false;
- $message = '';
- while (!$last_line)
- {
- $next_line = fgets($fp, 1024); // read the special file to get the user input from keyboard
- if (".\n" == $next_line)
- {
- $last_line = true;
- }
- else
- {
- $message .= $next_line;
- }
- }
- }
- typeWords();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement