fork download
  1. <?php
  2. $answers = [
  3. 1 => 'Да',
  4. 2 => 'Нет',
  5. 3 => 'Возможно'
  6. ];
  7. $question = 'Хватит ли мне пол года, чтобы освоить PHP?';
  8. $number = mt_rand(1,3);
  9. $answer = $answers[$number];
  10. echo "Вопрос: $question \n Ответ: $answer";
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
Вопрос: Хватит ли мне пол года, чтобы освоить PHP? 
 Ответ: Возможно