var_dump
函数显示变量/表达式的 struct 化信息,包括type和value.数组以递归方式进行探索,值缩进以显示 struct .它还显示哪些数组值和对象属性是引用.
print_r()
以人类可读的方式显示有关变量的信息.数组值将以显示keys和elements的格式显示.类似的符号用于对象.
Example:
$obj = (object) array('qualitypoint', 'technologies', 'India');
var_dump($obj)
将显示在屏幕输出下方.
object(stdClass)#1 (3) {
[0]=> string(12) "qualitypoint"
[1]=> string(12) "technologies"
[2]=> string(5) "India"
}
并且,print_r($obj)
将显示在屏幕的输出下方.
stdClass Object (
[0] => qualitypoint
[1] => technologies
[2] => India
)
More Info