Return to Snippet

Revision: 8729
at October 4, 2008 18:35 by jachin


Initial Code
$message   =  "Are you sure you want to do this [y/N]";
print $message;
flush();
ob_flush();
$confirmation  =  trim( fgets( STDIN ) );
if ( $confirmation !== 'y' ) {
   // The user did not say 'y'.
   exit (0);
}

Initial URL

                                

Initial Description
A basic confirmation question and test.

Initial Title
PHP Command Line Confirmation Prompt

Initial Tags

                                

Initial Language
PHP