// Version History // 0.0.1 Created blaquiz.php $version = "BlaQuiz Version: 0.0.1"; $questions = array ( "How many bits in a byte?", "What does TTP mean?" ); $answers = array ( "8", "Time To Poo" ); // get the input $stdin = read_stdin(); $stdin = explode(" ", $stdin); $out = ""; $token = ""; if(isset($stdin[0])) { switch ($stdin[0]) { case "-q": $id = rand(0,sizeof($questions) - 1); $out = "ID: $id $questions[$id]"; break; case "-a": if(isset($stdin[1]) && isset($stdin[2])) { //Check question ID $id = $stdin[1]; if($id < sizeof($questions)) { //get answer $answer = ""; for($i=2; $i