PHP and Hash Tables (or multi-dimensional arrays) [dimensional arrays]

Q: Is it possible to implement multi- in PHP?


Forex Roboteer, Fully Automated Trading Array
Re:Originally posted by: guy
Here's what I'm trying to do:

create an array of class A
inside class A, I need an array of class B

Is this possible?

New to OOP?


Create Unforgettable Characters For Your Fiction.
Re:Here's what I'm trying to do:

create an array of class A
inside class A, I need an array of class B

Is this possible?

nm, got it :)


Auto Submit To 3,000,000 Websites
Re:yep that works too

<?
class TeSt {
var $a;
var $b = "Fred";

// Notice the case difference in the constructor name

function Test() {
$classname = get_class($this); // $classname = "test"
$this->ra = get_class_vars($classname);
}
}

// Next line also works with Test(), TEST(), or test()
$obj = array();
$obj[0] = array();
$obj[0][0] = new TeSt();
print_r($obj[0][0]->ra);

?>


Ultimate Sled Dragging eBook
Re:How about an array of classes? is that possible?

5 Biblical Keys To Changing Your Life
Re:yep just gotta instantiate them..

$myHash = array();
$myHash[0] = array();
$myHash[0][0]="whatever";


Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]