PHP var_dump() Function

PHP 可用的函数PHP Available Functions

var_dump()The function is used to output relevant information about variables.

var_dump()The function displays structural information about one or more expressions, including the type and value of the expression. Arrays are expanded recursively to show their structure through indentation.

PHP Version Requirements: PHP 4, PHP 5, PHP 7

Syntax

void var_dump ( mixed $expression [, mixed $... ] )

Parameter description:

  • $expression: The variable you want to output.

Return Value

No return value.

Example

Example

<?php $a = array(1, 2, array("a", "b", "c")); var_dump($a); ?>

The output result is:

array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  array(3) {
    [0]=>
    string(1) "a"
    [1]=>
    string(1) "b"
    [2]=>
    string(1) "c"
  }
}

Example

<?php $b = 3.1; $c = true; var_dump($b, $c); ?>

The output result is:

float(3.1)
bool(true)

PHP 可用的函数PHP Available Functions

Other Extensions