PHP var_dump() function17 Mar 2025 | 2 min read The var_dump() function is a built-in function of PHP that dumps the information about the variables. This information includes the data type and value of the variable. In case of string, it also includes the size of the string passed inside the function. The array and object are explored recursively with values to show their structure. In simple words, this function provides structured information about one or more variables. SyntaxNote: It directly outputs the result to the browser.ParameterExpression (var1, var2, ...): variable or the value of the variable, which you want to dump. Return TypeIt does not return any value. ExamplesPHP var_dump(): with numeric and Boolean value In case of numeric and boolean values, it prints only data type and value of the variable. See the example below to understand it better. Output: int(25) bool(true) PHP var_dump(): with string Output: string(10) "Hello Alex" string(21) "Welcome to javatpoint" Let's understand with the help of a diagram: ![]() PHP var_dump(): multiple arguments The var_dump() function allows us to pass multiple arguments of different types. It can dump two or more variables together. Output: int(23) string(11) "Hello world" PHP var_dump(): with array The var_dump() function allows arrays to be explored recursively with values to show their structure. Output: array(3) { [0]=> string(8) "Mercedes" [1]=> string(3) "BMW" [2]=> string(4) "Audi" } array(4) { [0]=> int(52) [1]=> string(3) "Bye" [2]=> float(91.3) [3]=> array(3) { [0]=> string(5) "Apple" [1]=> string(10) "Blackberry" [2]=> string(7) "Android" } } Note: The var_dump() function comes under the category of variable handling.Next TopicPHP Regular Expressions |
One can build and design a website very easily. If we want to create any website without having prior knowledge about web development, design, or coding, then we can create a website using various tools and resources available over the internet. We can create a website for...
8 min read
PHP is an open-source programming language that is used to encourage static or dynamic web backends. PHP addresses Hypertext Pre-processor, which earlier addressed Personal Home Pages. It is the speediest and most by and large used server-side setting up language for building locales and web applications....
10 min read
It is same as require, but only one time it includes the external file. Example 1 Save as page1.php Save as page2.php Output: Topicinclude_once ...
1 min read
PHP unset( ) is an inbuilt function mainly used to unset a specified variable. The function of that variable depends upon various factors. Suppose a certain function is called inside of a user-declared function. In that case, it will unset the variable associated value and leave...
4 min read
AJAX: What is it? Asynchronous JavaScript and XML are referred to as AJAX. Using XML, HTML, CSS, and JavaScript, AJAX is a new method for developing online applications that are better, faster, and more interactive. Synchronous requests are used by traditional web applications to send and receive...
4 min read
The Imagick::addImage() method is a PHP built-in function for adding new images to the Imagick object image list. Following the operation, the iterator is relocated to the end of the list. This function adds a new picture to an Imagick object based on the source object's...
5 min read
PHP has a built-in function called GMP export() that turns a GMP number into a binary string. Syntax The given syntax shows the PHP GMP export function. string gmp_export (GMP $numbers, int $num_size, int $option_nums); Parameters As shown above syntax and explained below, the GMP gmp_export() function takes three parameters: $numbers: This...
3 min read
PHP empty ( ) Function The empty() function is an inbuilt function in PHP, which is utilized to check regardless of whether a variable is unfilled or not. Syntax bool empty ( $ variable name ) Parameters: This function acknowledges a solitary parameter as displayed in above syntax and portrayed...
4 min read
In this article, we will work on the comparison between the dates in PHP. Comparing the dates in PHP is not a tedious task when the dates are in a similar format, but when we compare the dates in a different format, it becomes difficult. Then we...
4 min read
PHP and C have most of the same syntax rules. PHP is a language for server-side scripting. Text files with the ".php" suffix are used to store PHP code. Basic Structure of a PHP Script PHP scripts are included within the HTML, and they have to begin...
6 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India