September 2001
Intermediate to advanced
768 pages
32h 45m
English
string get_class(object obj) Finds the class of the given object.
Returns:
Name of an object’s class; FALSE if the variable passed is not an object
Description:
get_class() finds the class of which the given object obj is an instance. If obj is not an instance of a class, the function returns FALSE.
Availability:
UNIX, Windows
Version:
4.0b2+
See also:
The other object functions
To find the type of a variable:
gettype()
To find out whether a variable is an object:
is_object()
Example:
class fruit { var $name; var $shape; var $color; function fruit ($name, $shape, $color) { $this->name = $name; $this->shape = $shape; $this->color = $color; } } $object = new fruit ('tomato', ... |
Read now
Unlock full access