PHP code example of diolan12 / php-lipsum

1. Go to this page and download the library: Download diolan12/php-lipsum library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

diolan12 / php-lipsum example snippets


use Diolan12\LoremIpsum;


$lipsum = new LoremIpsum();

$lipsum = new \Diolan12\LoremIpsum();

use Diolan12\LoremIpsum;


$lipsum = LoremIpsum::instance();

$lipsum = \Diolan12\LoremIpsum::instance();

use Diolan12\LoremIpsum;


$lipsum = LoremIpsum::instance();
echo $lipsum->words()."\n";
echo $lipsum->words(5);

use Diolan12\LoremIpsum;


$lipsum = LoremIpsum::instance();
echo $lipsum->sentences()."\n\n";
echo $lipsum->sentences(2);

use Diolan12\LoremIpsum;


$lipsum = LoremIpsum::instance();
echo $lipsum->paragraphs();

use Diolan12\LoremIpsum;


echo LoremIpsum::instance()->wrap()->words(3)."\n";
echo LoremIpsum::instance()->wrap('span')->words(3);

use Diolan12\LoremIpsum;


$lipsum = LoremIpsum::instance();

echo $lipsum->words()."\n";

$lipsum->wrap(); // set wrapper with default tag <p>
echo $lipsum->words()."\n";

$lipsum->wrap(null); // disable wrapper with null value
echo $lipsum->words()."\n";

$lipsum->wrap('span'); // set wrapper with <span>
echo $lipsum->words()."\n";
cli
composer