Copy the Code code as follows:
class MyClass {
var $var 1;
var $var 2 = ' xyz ';
var $var 3 = 100;
Private $var 4;
function MyClass () {
$this->val1 = "Foo";
$this->val2 = "Bar";
return true;
}
function Test1 () {
return true;
}
}
Get_class_methods () returns an array of the method names of the class
Get_class_methods (' MyClass ') or Get_class_methods (new MyClass ());
Get_class () returns the class name of the object
Get_class_vars () returns an array of default properties of the class
$my _class = new MyClass ();
$class _vals = Get_class_vars (Get_class ($my _class));
foreach ($class _vars as $name = + $value) {
echo "$name: $value \ n
";
}
?>
The above describes the pretty rhythm dear my future php to obtain a class of properties and methods of implementation code, including pretty rhythm dear my content, I hope to be interested in PHP tutorial friends helpful.