Home > Backend Development > PHP Tutorial > PHP var_dump()_PHP Tutorial

PHP var_dump()_PHP Tutorial

WBOY
Release: 2016-07-13 17:47:10
Original
1003 people have browsed it

The php var_dump function is to determine the type and length of a variable, and output the value of the variable. If the variable has a value, the value of the variable is lost and the data type is returned. This function displays structural information about one or more expressions, including expressions The type and value of the formula. Arrays will expand values ​​recursively, showing their structure through indentation.

Its format: var_dump ( mixed expression [, mixed expression [, ...]] )

Let’s take a look at var_dump syntax:

var_dump (var,var,bar);

Let’s take a look at an example I just gave.

$ta =1;

$tb ='t';

echo var_dump($ta,$tb);

?>

The output is

int(1) string(1) “t”

The first number is int(1)

It's simple, but one thing to note is that the variables in var_dump must exist. If the variable exists but the value is empty, false will be returned; if there is no variable, NULL will be returned.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478538.htmlTechArticlephp var_dump function is to determine the type and length of a variable and output the value of the variable. If the variable has a value, output is the value of the variable and returns the data type. This function displays information about one or more...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template