PHP - print all properties of an object

后端 未结 6 1594
野的像风
野的像风 2020-12-08 03:36

I have an unknown object in php page.

How can I print/echo it, so I can see what properties/values do it have?

What about functions? Is there any way to kno

6条回答
  •  心在旅途
    2020-12-08 04:29

    var_dump($obj); 
    

    If you want more info you can use a ReflectionClass:

    http://www.phpro.org/manual/language.oop5.reflection.html

提交回复
热议问题