PHP Classes
elePHPant
Icontem

PHP Lipsum Generator: Generate random text based on lorem ipsum template

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-08-08 (11 months ago) RSS 2.0 feedNot enough user ratingsTotal: 194 All time: 7,534 This week: 1,099Up
Version License PHP version Categories  
lipsum-generator 1.3GNU Lesser Genera...5.3PHP 5, Debug, Text processing
Description Author  

This class can generate random text based on lorem ipsum template.

It can generate a random text with a number of words between a given minimum and maximum range of words.

The generated text is based on the lorem ipsum template but the base template text can be changed. The generate text may start from the beginning of the template or another word position.

The class can generate a single paragraph or multiple paragraphs.

Picture of Asbjorn Grandt
Name: Asbjorn Grandt <contact>
Classes: 9 packages by
Country: Denmark Denmark
Age: 43
All time rank: 2251 in Denmark Denmark
Week rank: 101 Up1 in Denmark Denmark Equal
Innovation award
Innovation award
Nominee: 3x

Details provided by the author  
PHPLipsumGenerator
==================

Create garbled, non repetitive "chapters" using the standard Lorem Ipsum text as a basis.


## License
LGPL 2.1

### Guide

The intention is to help debug or test text input, by being quickly able to generate vast amounts of non predictable text. 

The user can set the source text to something different than the original Latin Lorem text, if desired.

To use the class, simply call generate with these parameters, all of which are optional:

* $minWordCount (integer)
  Default: 200.
* $maxWordCount (integer)
  Default: 2000.
* $useMultipleParagraphs (boolean)
  Generate a text with multiple paragraphs.
  Default: TRUE. 
* $startWithLorem (boolean)
  Will start each chapter with the text "Lorem ipsum dolor sit amet, consectetur adipisicing elit.", the length of which is subtracted from the $minWordCount. Used to help identify the place holder text for what it really is.
  Default: TRUE.
* $indent (String)
  Indentation of each new paragraph in the generated text.
  Default: "  " (two spaces).
* $eol (String)
  End of line sequence.
  Default: The Windows new line sequence ("\r\n").

generateHTML is a convenience method, identical to generate, but where $indent="&lt;p&gt;" and $eol="&lt;/p&gt;\r\n".
  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Example Initial Version
Plain text file LipsumGenerator.php Class Initial Version
Accessible without login Plain text file README.md Doc. Short readme

 Version Control Unique User Downloads Download Rankings  
 100%Total:194All time:7,534
 This week:0This week:1,099Up