PHP面向对象设计总结

获取对象属性 get_object_vars

注意: get_class_vars 获取的属性的值是初始化的默认值,不是运行过程中,更改的值。

get the classname without the namespace

function get_class_name($classname)
{
    if ($pos = strrpos($classname, '\')) return substr($classname, $pos + 1);
    return $pos;
}
原文地址:https://www.cnblogs.com/aworkstory/p/13272547.html