Zend Certified Engineer

phpguru.org

Quality PHP, Javascript and C# code
Download RGraph: HTML5 canvas graph library... Home ~ Downloads ~ FAQs ~ Licensing
RSS Feed RSS Feed
Follow me on Twitter Follow me on Twitter

Articles

HTML5

Javascript

PHP5

PHP4




Bookmark with delicious Stumble! this site tweet this site Buzz this!

Console_Table class

This class provides an API to easily generate tables for Console applications (like the tables generated by the MySQL client application in SELECT queries). Eg:

+----------+----------+------------+----------+
| Header 1 | Header 2 | Header 3   | Header 4 |
+----------+----------+------------+----------+
| 1        | 2        | 10/08/2002 | 1        |
| one      | two      | 11/08/2002 | 2        |
| foo      | bar      | 12/08/2002 | 3        |
+----------+----------+------------+----------+

The code used to generate the above table is:


<?php
include_once('Console/Table.php');

$table = &new Console_Table();

$table->addRow(array(123));
$table->addRow(array('one''two''three'));

$table->insertRow(array('foo''bar'), 2);

$table->addCol(array('1''2''3'), 3);
$table->addCol(array('10/08/2002''11/08/2002''12/08/2002'), 2);

$table->setHeaders(array('Header 1''Header 2''Header 3''Header 4'));

echo 
$table->getTable();
?>

This class is available here.



RGraph: HTML5 canvas graph library

Example graph made using RGraph

If you're interested in web development, then you may also be interested in RGraph: HTML5 canvas graph library. It uses HTML5 features to produce a wide variety of graph types. Because it moves the creation of graphs from the server to the client, it can significantly reduce the load on your server and your bandwidth usage.