为什么我转出来就是一个 public name的字符串
//对象转json
class a{
public $name = "public name";
protected $b = 'protected name';
private $c = 'private name';
public function show(){
return $this->name;
}
}
echo "<hr/>";
$obj = new a();
print_r($obj);
$thi = json_encode($obj);
echo $thi;
为什么我转出来就是一个 public name的字符串