Random::paragraphs

public Random::paragraphs($paragraph_count = 12)

Generate paragraphs separated by double new line.

Parameters

int $paragraph_count:

Return value

string

File

core/lib/Drupal/Component/Utility/Random.php, line 251

Class

Random
Defines a utility class for creating random data.

Namespace

Drupal\Component\Utility

Code

public function paragraphs($paragraph_count = 12) {
  $output = '';
  for ($i = 1; $i <= $paragraph_count; $i++) {
    $output .= $this->sentences(mt_rand(20, 60)) . "\n\n";
  }
  return $output;
}
doc_Drupal
2016-10-29 09:36:19
Comments
Leave a Comment

Please login to continue.