In Java (well, Android's version at least) all objects have a getClass()
method which returns the object's class and you can then call getSimpleName()
to get the human-readable name of the object. This is great for logging. I'd like to be able to do something similar in a PHP program I've been working on. Is there any way to find out what type of object "this" is?
return get_class($this);
I think this php.net man page may have the answers your looking for: http://php.net/manual/en/function.get-class.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With