php-general | 2005051
Date: 05/05/05
- Next message: William Stokes: "Re: [PHP] sort by date"
- Previous message: William Stokes: "[PHP] Re: sort by date"
- Next in thread: Jochem Maas: "Re: [PHP] Array of objects"
- Reply: Jochem Maas: "Re: [PHP] Array of objects"
- Maybe reply: Jochem Maas: "Re: [PHP] Array of objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected> <mailto:info <email protected>>
Web: www.spiraleye.co.za
- Next message: William Stokes: "Re: [PHP] sort by date"
- Previous message: William Stokes: "[PHP] Re: sort by date"
- Next in thread: Jochem Maas: "Re: [PHP] Array of objects"
- Reply: Jochem Maas: "Re: [PHP] Array of objects"
- Maybe reply: Jochem Maas: "Re: [PHP] Array of objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

