PHP » PYTHON |
login |
register |
about
|
PYTHON get_class
is this article helpful?
|
Python replacement for PHP's get_class
[
edit
| history
]
# this returns the type object: type(object) # if you really want the name, just do type(object).__name__ get_class(PHP 4, PHP 5) get_class — Returns the name of the class of an object Description
string get_class
([ object $object
] )
Gets the name of the class of the given object . Parameters
Return ValuesReturns the name of the class of which object is an instance. Returns FALSE if object is not an object. Changelog
Examples
Example #1 Using get_class()
<?php The above example will output: Its name is foo My name is foo
Example #2 Using get_class() in superclass
<?php The above example will output: string(3) "foo" string(3) "bar"
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|