<?php
 
// Show everything
error_reporting( E_ERROR | E_WARNING | E_PARSE | E_NOTICE );
 
$thesaurus_array = array(
    // An array of the first word
    array( 'Чудесных', 'Суровых', 'Занятных', 'Внезапных' ),
        
    // An array of the first word
    array( 'слов', 'зим', 'глаз', 'дней', 'лет', 'мир', 'взор' ),
        
    // An array of the third word / phrase
    array( 'прикосновений', 'поползновений', 'судьбы явлений', 'сухие листья', 'морщины смерти', 'долины края', 'замены нету', 'сухая юность', 'навек исчезнув'),
    
    // An array of the fourth word
    array( 'обретаю', 'понимаю', 'начертаю', 'закрываю', 'оставляю', 'вынимаю', 'умираю', 'замерзаю', 'выделяю' ),
        
    // An array of the fifth word / phrase
    array('очертания', 'безысходность', 'начертанья', 'смысл жизни', 'вирус смерти', 'радость мира')
);

// Foreach 3 times
for ( $sentence = 1; $sentence <= 3; $sentence++ ) {
    // Create an array with sentences
    $sentences = array();
    
    // Loop through the all words / phrases
    foreach( $thesaurus_array as $order => $word ) {
        // Get a random index
        $randomized_index = array_rand($thesaurus_array[$order]);
        // Echo the next resulting word in the queue
        $sentences[] = $thesaurus_array[$order][$randomized_index];
    }
    
    // Is line break needed?
    $line_break = ( $sentence == 3 ) ? "" : "<br>\n";
    // Sentence is complete, break to the next line
    echo implode( ' ', $sentences ) . $line_break;
}
