Dive into the details of the php var_dump of function

  • 2020-06-03 06:08:56
  • OfStack

The php var_dump function determines the type and length of a variable and outputs the value of the variable. If the variable has a value, it inputs the value of the variable and returns the data type.
Take a look at var_dump syntax:


var_dump (var,var,bar);

Let's take a look at my first example.

<?php
  $ta =1;
  $tb ='t';
  echo var_dump($ta,$tb);
?>

The output is

int(1) string(1) "t"

The first number is int(1).
Simple, but one thing to note, with var_dump, the variable must exist. If the variable exists but has an empty value, it will return false.

PHP: What is the var_dump() function for?
Such as var_dump ($get); What does that mean?
==========================================
This function displays structural information about one or more expressions, including the type and value of the expression.


Related articles: