Hi there,
I
need help with arrays. What I want to do is to have an array of the following
structure:
$mod=array(
‘name’=>new NameObject());
Then
later in the page I want to go $Site = $mod[$_GET[‘module’]] (or something
like that) to instantiate a new object.
The
problem is, if done the way above it will try to instantiate the object right
there and then in the array (defeating the purpose), if I put it in quotes and
try to use something like:
(object)eval($mod[$_GET[‘module’]])
it does not instantiate the object. Is there a way to do this?
Thanks
Thomas
|