Okay I've just done a class with a multi dimensional arrray. I'll try and talk you through it.
First - You have to decalre the array in the definitions of the class e.g.
var $detials = array(array());
okay that said and done, it is good coding pratice to then set up the array so a function such as :
function setdetails()
{
return $this->details;
}
Thiss simply creates some memory space for the array, not especially needed but hey 🙂
Now to acutally use the array I used this function
function getdetails($result){
for ($rowcount = 0; $rowcount < $this->no_rows; $rowcount++){
$row = mysql_fetch_row($result);
for ($fieldcount = 0; $fieldcount < $this->no_fields; $fieldcount++)
{
$this->details[$fieldcount][$rowcount] = $row[$fieldcount];
}
}
return $this->details;
}
My array as you can see holds some information form a database essentially using the array like a table.