get class of variable php code example Example 1: php get class name of this get_class($this); Example 2: php get object class get_class($object);