Home >Backend Development >PHP Tutorial >Introduction to the usage of var_dump() method in php

Introduction to the usage of var_dump() method in php

WBOY
WBOYOriginal
2016-07-25 08:58:191501browse
This article introduces the usage of the var_dump() method in PHP. Friends in need can refer to it.

An example of var_dump usage is as follows:

<?php
/**
* var_dump用法举例
* edit bbs.it-home.org
*/
$a = "alsdflasdf;a";
$b = var_dump($a);
echo "<br>";
//var_dump($c);
$d=var_dump($c);
echo "<br>";
echo $a;
echo "<br>";
echo $b;
echo "<br>";
?>

Output: string(12) "alsdflasdf;a" NULL alsdflasdf;a

Instructions: The var_dump() method determines the type and length of a variable and outputs the value of the variable. If the variable has a value, the output is the value of the variable and returns the data type. Displays structural information about one or more expressions, including the expression's type and value. Arrays will expand values ​​recursively, showing their structure through indentation.

Format: var_dump ( mixed expression [, mixed expression [, ...]] )

Syntax: var_dump (var,var,bar);

Note: Use to ensure that the variable in var_dump must exist. If the variable exists but the value is empty, false is returned; If there is no variable, NULL is returned. This function has an output function, so there is no need to add other output functions.



Statement:
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