jump to navigation

Generating Lorem Ipsum text with PHP June 17, 2011

Posted by Tournas Dimitrios in PHP.

Lorem Ipsum is a group of text that people commonly use as filler text, or dummy text.  It’s basically a bunch of randomly generated Latin words  that people use to show what a design layout will look like when the proper text has been inserted. What is the reason for using  a foreign language and not some English text?  It all comes down to focus. It’s a known fact that if they were to use actual copy, someone trying to look at only the design would be distracted by what the text says.  That is one of the major reasons people choose to use Lorem Ipsum. With text that is unrecognizable, there’s nothing to read.

There are many on-line Lorem ipsum generators , for almost all languages , this is my favorite generator . PHP can be used to generate Lorem Ipsum text . This Class , created by Mathew Tinsley ,  is an alternative approach to generate random text .  A very basic example is :


$generator = new LoremIpsumGenerator;
echo " <h1>1000 words in html format</h1>" ;
$htmlformat = $generator->getContent(1000);
echo "$htmlformat<hr>";



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s