// Simple tree class // || || class Node { private $nodeId, $nodeName; private static $nodeList; private static $nodeCount; function __construct($nodeId, $nodeName) { $this->nodeId = $nodeId; $this->nodeName = $nodeName; Node::$nodeList[] = $this; Node::$nodeCount++; } // function to draw nodeTree static function draw() { foreach(Node::$nodeList as $key => $val) { echo $val->nodeName; echo "
"; } } } $rootNode = new Node(0, "[-]Rootnode[-]"); $omgNode = new Node(1,"lol"); $subNode = new Node(0,"[+]Subnode[+]"); Node::draw(); ?>