我使用print_r()是因为我喜欢漂亮的数组结构......但var_dump确实给了你更多的信息(比如类型)
$obj = (object) array(1, 2, 3);
// output of var_dump:
object(stdClass)#1 (3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
// output of print_r
stdClass Object
(
[0] => 1
[1] => 2
[2] => 3
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9244 次 |
| 最近记录: |