Archive

Archive for the ‘php’ Category

Automatic generation of html-tables

November 17th, 2009 No comments

This class automatically generates html-tables from multi-dimensional arrays. The tables are completly customizable by assigning parameters to the standard-table tags like table, tr, th and td.

Download here.

simple MySQL class for php

July 30th, 2009 No comments

Doing all this database-stuff in php is really a mess. For that case I started a simple MySQL class. At the moment there is not more than connecting and making simple selects. Will be updated soon.

Documentation will (perhaps) follow. Its not that complicated. ;)

Download file here.

quick import constructor

May 12th, 2009 No comments

This snipplet shows how to automatic import parameters into a class, restricted to the variables defined in the head of the class.

class Demo
{
  var $a, $b, $c
 
  function Demo($data)
  {
    while(list($key,$value)=each($data)){
      if(isset($this->$key)){
        $this->$key = $value;
      }
    }
  }
}