Login   Register  
PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Asbjorn Grandt  >  PHP Lipsum Generator  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Initial Version
Class: PHP Lipsum Generator
Generate random text based on lorem ipsum template
Author: By
Last change: Split is deprecated in newer PHP versions

Changed to Explode. And fixed a problem in setLipsumText
Thanks to António Lourenço for pointing this out.
Date: 9 months ago
Size: 1,032 bytes


Class file image Download
<!DOCTYPE html>
        <title>Lipsum Generator Test</title>
        <h1>Lipsum Generator Test</h1>
ini_set('error_reporting'E_ALL E_STRICT);

$lg = new com\grandt\php\LipsumGenerator();
        <p><strong>Between 300 and 1000 words:</strong></p>
        <pre><?= $lg->generate(3001000?></pre>

        <p><strong>Between 50 and 100 words, single paragraph:</strong></p>
        <pre><?= $lg->generate(50100FALSE?></pre>

        <p><strong>Between 50 and 100 words, multiple paragraphs. Don't start with the default 8 word 'Lorem Ipsum...':</strong></p>
        <pre><?= $lg->generate(50100TRUEFALSE?></pre>

        <p><strong>Between 50 and 100 words, multiple paragraphs. Don't start with the default 8 word 'Lorem Ipsum...', as HTML Paragraphs:</strong></p>
        <div style="background-color: #ddd; border: 1px solid black;">
<?= $lg->generateHTML(50100TRUEFALSE?>