Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

MessageHandler-Example

Sections:

Info

Example Code

The following code demonstrates how to use the class.

<?php
/*!***********************************************************************
 *************************************************************************
 * \file            msghandler-sample.php
 *
 * \author          Kai Klenovsek
 *
 * \date            First Step: 2005-04-13
 *
 * \note <br>
 * \b THE \bBEER-WARE \bLICENSE <br>
 *   As long as you retain this notice you can do whatever you want with <br>
 *   this stuff. If we meet some day, and you think this stuff is worth it, <br>
 *   you can buy me a beer in return. <br>
 *
 * \b NOTES: <br>
 *   
***************************************************************************
***************************************************************************/

// First we have to include the phplibex 
require("../../phplibex.inc.php");

// Create object from class
$msg = new msghandler();

// Add a message
$msg->msg_add( "This is my first message" );

// Add another message
$msg->msg_add( "This is my second message" );

// Get number of messages from buffer
echo "<b>Number of messages: </b>".$msg->msg_getsize()."<br>";

// Get size in byte from buffer
echo "<b>Size of buffer in byte: </b>".$msg->msg_getsize_byte()."<br>";

// Get a single message
echo "<b>Message 2: </b>".$msg->msg_get( 2 )."<br><br>";

// Get and show complete list
$list = $msg->msg_getlist();

echo "<b>Complete message list: </b><br>";
for( $index=0; $index <= sizeof($list); $index++ )
    echo $list[$index]."<br>";

?>

Generated on Fri Aug 26 08:13:54 2005 for PHP-Lib-Xtreme by  doxygen 1.4.3