Page 1 of 1

Get the exact name/type of a user-defined object

Posted: Sat Jun 24, 2006 9:07 pm
by mcccy005
I have written several form classes (eg. text_field, radio_field etc.) including a comment_field object.
I need to determine if a particular object is of type 'comment_field'.

gettype( ) appears to only return a list of known objects (boolean, integer, string etc) and 'resource' (which I think is supposed to represent any user-defined function and probably other things.
Is there a function I can call which will return the string name of the object??

Eg.

Code: Select all

$comment = new comment_field( );
if(<<get_object_type_function>>($comment)=='comment_field') break
else ....

Thanks.

Posted: Sat Jun 24, 2006 9:11 pm
by feyd