Array of objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Spiraleye.Studios

  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


SPIRAL EYE STUDIOS

P.O. Box 37907, Faerie Glen, 0043

Tel: +27 12 362 3486
Fax: +27 12 362 3493
Mobile: +27 83 258 2669
Email: info@xxxxxxxxxxxxxxx
Web: www.spiraleye.co.za

 


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux