fork download
  1. <?php
  2.  
  3. // Show everything
  4. error_reporting( E_ERROR | E_WARNING | E_PARSE | E_NOTICE );
  5.  
  6. $thesaurus_array = array(
  7. // An array of the first word
  8. array( 'Чудесных', 'Суровых', 'Занятных', 'Внезапных' ),
  9.  
  10. // An array of the first word
  11. array( 'слов', 'зим', 'глаз', 'дней', 'лет', 'мир', 'взор' ),
  12.  
  13. // An array of the third word / phrase
  14. array( 'прикосновений', 'поползновений', 'судьбы явлений', 'сухие листья', 'морщины смерти', 'долины края', 'замены нету', 'сухая юность', 'навек исчезнув'),
  15.  
  16. // An array of the fourth word
  17. array( 'обретаю', 'понимаю', 'начертаю', 'закрываю', 'оставляю', 'вынимаю', 'умираю', 'замерзаю', 'выделяю' ),
  18.  
  19. // An array of the fifth word / phrase
  20. array('очертания', 'безысходность', 'начертанья', 'смысл жизни', 'вирус смерти', 'радость мира')
  21. );
  22.  
  23. // Foreach 3 times
  24. for ( $sentence = 1; $sentence <= 3; $sentence++ ) {
  25. // Create an array with sentences
  26. $sentences = array();
  27.  
  28. // Loop through the all words / phrases
  29. foreach( $thesaurus_array as $order => $word ) {
  30. // Get a random index
  31. $randomized_index = array_rand($thesaurus_array[$order]);
  32. // Echo the next resulting word in the queue
  33. $sentences[] = $thesaurus_array[$order][$randomized_index];
  34. }
  35.  
  36. // Is line break needed?
  37. $line_break = ( $sentence == 3 ) ? "" : "<br>\n";
  38. // Sentence is complete, break to the next line
  39. echo implode( ' ', $sentences ) . $line_break;
  40. }
  41.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
Суровых взор сухая юность обретаю очертания<br>
Занятных лет прикосновений умираю безысходность<br>
Чудесных слов долины края вынимаю смысл жизни