MENU
Display
get_defined_vars() returns an array of all defined variables, be them environment, server, or user-defined variables.RESETRUNFULL
<!DOCTYPE html>
<html>
<head></head>
<body>
<?php
$v=10;
$va=get_defined_vars();
echo $va['v'];
echo $va['_COOKIE']['test'];
?>
</body>
</html>
print_r($m[,$b=false]) displays information about $m. If $b is true, the function will return the information rather than print it. var_dump ($m1[,$m2……]) displays information about $m1, $m2……var_export($m[,$b=false]) displays information about $m. The output is valid PHP code. If $b is true, the function will return the information rather than print it. debug_zval_dump($m) displays information about an internal zend value $m.
<!DOCTYPE html>
<html>
<head></head>
<body>
<?php
$a=[1,2,['hello','world']];
print_r($a); echo '<br /><br />';
var_dump($a); echo '<br /><br />';
var_export($a); echo '<br /><br />';
debug_zval_dump($a);
?>
</body>
</html>
Array ( [0] => 1 [1] => 2 [2] => Array ( [0] => hello [1] => world ) ) array(3) { [0]=> int(1) [1]=> int(2) [2]=> array(2) { [0]=> string(5) "hello" [1]=> string(5) "world" } } array ( 0 => 1, 1 => 2, 2 => array ( 0 => 'hello', 1 => 'world', ), ) array(3) refcount(2){ [0]=> long(1) refcount(1) [1]=> long(2) refcount(1) [2]=> array(2) refcount(1){ [0]=> string(5) "hello" refcount(1) [1]=> string(5) "world" refcount(1) } }