PHP Classes

File: example.php

Recommend this page to a friend!
  Packages of Pavel   Lite Comment   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Basic usage example
Class: Lite Comment
Render formatted text as HTML
Author: By
Last change:
Date: 15 years ago
Size: 826 bytes
 

 

Contents

Class file image Download
<?php
/*
   LiteComment is a lightweight text formatter working with blazingly fast speed.
   The project's homepage is: http://proger.i-forge.net/LiteComment

   If you need a full-fledged text formatting framework you might be interested in
   UverseWiki, http://uverse.i-forge.net/wiki
*/

require 'litecomment.php';

  function FormatLC($text) {
    $text = trim( str_replace("\r", '', $text) );
    $text = htmlspecialchars($text);

    $lc = new LiteComment($text);
    return $lc->FormatInHTML();
  }

echo FormatLC('*Hello, world!*'), "<br />\n",
     FormatLC('a link point to nowhere: http://google.com'), "<br />\n",
     FormatLC('some@maili.ng'), "<br />\n";

echo FormatLC('
== Story title ==
A quotation follows:
"
Once upon a time...
"
"That\'s a *nice* reading!" - he said.
');