Hi,
Is there a way to instantiate an object by string?
The current project I am working on is to create a set of php files, each containing a class derived(extende d) from 1 particular base class.
Each PHP's filename contains the name of the class it embeds. (e.g. "ClassABC.p hp" contains "class ABC extends")
With string manipulation I am able to extract the text "ABC" from the filename.
Now I'd like to build an array of base class type and instantiate ABC as one of the elements on that array.
So how could I do that having the string "ABC"?
Is there a way to instantiate an object by string?
The current project I am working on is to create a set of php files, each containing a class derived(extende d) from 1 particular base class.
Each PHP's filename contains the name of the class it embeds. (e.g. "ClassABC.p hp" contains "class ABC extends")
With string manipulation I am able to extract the text "ABC" from the filename.
Now I'd like to build an array of base class type and instantiate ABC as one of the elements on that array.
So how could I do that having the string "ABC"?
Comment