- var_dump: documentation ( source)
- json_decode: documentation ( source)
- get_object_vars: documentation ( source)
- get_class_vars: documentation ( source)
- constant: documentation ( source)
- define: documentation ( source)
<?php
define("MAXSIZE", 100);
//echo eval("MAXSIZE");
echo constant("MAXSIZE");
class T {
public $a;
public $b;
}
$obj = new T();
$cls = get_class($obj);
$vars = get_class_vars($cls); //ๅ้ๅ่กจ
var_dump($vars);
$str = '{"a":"pa","b":"pb"}';
$obj = json_decode($str,false); //$obj is stdclass
$cls = get_class($obj);
$vars = get_object_vars($cls);
var_dump($vars);