深入php中var_dump方法的使用详解
首先看看实例:
复制代码 代码如下:
$a = "alsdflasdf;a";
$b = var_dump($a);
echo "
";
//var_dump($c);
$d=var_dump($c);
echo "
";
echo $a;
echo "
";
echo $b;
echo "
";
输出:
string(12) "alsdflasdf;a"
NULL
alsdflasdf;a
什么意思呢?var_dump()方法是判断一个变量的类型与长度,并输出变量的数值,如果变量有值输的是变量的值并回返数据类型.此函数显示关于一个或多个表达式的结构信息,包括表达式的类型与值。数组将递归展开值,通过缩进显示其结构。
它的格式:var_dump ( mixed expression [, mixed expression [, ...]] )
来看看var_dump 语法:
var_dump (var,var,bar);
要注意一点,用var_dump里面的变量必须是存在的,如果变量存在但值是空的就会返回false;没有变量则返回NULL.他自己就有输出的功能。不必加其他的输出函数。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use