php get_class()函数,phpget_class函数
程序员文章站
2022-03-15 22:16:29
...
php get_class()函数,phpget_class函数
php class Car { function getName(){ echo "My name is " . get_class() . "
"; echo "My name is " . get_class($this) . "
"; } } //类内部调用 $bar = new Car(); $bar->getName(); //类外部调用 echo "Its name is " . get_class($bar) . "
"; ?>
运行结果
My name is Car
My name is Car
Its name is Car
下一篇: 用Php如何操作LDAP_PHP教程