<?php
// "Cell" class
class Cell
{
var $myData;
function Cell()
{
$this->myData = 0;
}
function assignCellVal($val)
{
$this->myData = $val;
}
}
// "Row" class
class Row
{
var $myCell;
function Row()
{
// create instance of "Cell"
$this->myCell = new Cell();
}
function assignCellVal($val)
{
$this->myCell->assignCellVal($val);
}
}
// "Table" class
class Table
{
var $myRow;
function Table()
{
// create instance of "Row"
$this->myRow = new Row();
}
function assignCellVal($val)
{
$this->myRow->assignCellVal($val);
}
}
// Create instance of "Table"
// ... which in turn creates a "Row"
// ... which in turn creates a "Cell"
$myTable = new Table();
// Assign a value directly to a cell
$myTable->myRow->myCell->myData = 25;
// Or use proper method invocation
$myTable->assignCellVal(50);
print "The Data Value Is " . $myTable->myRow->myCell->myData;
?>
HTH
-- Rich Rijnders
-- Irvine, CA US