...
# php-loremipsum [](https://github.com/joshtronic/php-loremipsum/blob/master/LICENSE)  [](https://travis-ci.org/joshtronic/php-loremipsum) [](https://coveralls.io/github/joshtronic/php-loremipsum?branch=master) [](https://packagist.org/packages/joshtronic/php-loremipsum) Lorem ipsum generator in PHP without dependencies. Compatible with PHP 5.3+. ## Installation The preferred installation method is via `composer`. First add the following to your `composer.json`: ```json "require": { "joshtronic/php-loremipsum": "dev-master" } ``` Then run `composer update`. ## Usage ### Getting Started ```php $lipsum = new joshtronic\LoremIpsum(); ``` ### Generating Words ```php echo '1 word: ' . $lipsum->word(); echo '5 words: ' . $lipsum->words(5); ``` ### Generating Sentences ```php echo '1 sentence: ' . $lipsum->sentence(); echo '5 sentences: ' . $lipsum->sentences(5); ``` ### Generating Paragraphs ```php echo '1 paragraph: ' . $lipsum->paragraph(); echo '5 paragraphs: ' . $lipsum->paragraphs(5); ``` ### Wrapping Text with HTML Tags If you would like to wrap the generated text with a tag, pass it as the second parameter: ```php echo $lipsum->paragraphs(3, 'p'); // Generates:
Lorem ipsum...
...
...
``` Multiple tags can also be specified: ```php echo $lipsum->sentences(3, ['article', 'p']); // Generates:...
...
...