


What is the difference between the three functions var_dump, var_export and print_r in php?
This article is a detailed analysis and introduction to the differences between the three functions of var_dump, var_export and print_r in PHP. Friends in need can refer to it
The following example looks at the specific differences between these three functions. Var_dump and var_export are less commonly used, but they are very similar. So you can take a look:
The code is as follows:
<?php $a = array(1,1,32,322,3433,array(32,232,23232)); $b = 1234; $c = "alsdfl;asdf"; $d = 'a'; $e = fopen("slsl.txt", "r"); var_dump($a); echo "<br>"; var_dump($b); echo "<br>"; var_dump($c); echo "<br>"; var_dump($d); echo "<br>"; var_dump($e); echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; var_export($a); echo "<br>"; var_export($b); echo "<br>"; var_export($c); echo "<br>"; var_export($d); echo "<br>"; var_export($e); echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; print_r($a); echo "<br>"; print_r($b); echo "<br>"; print_r($c); echo "<br>"; print_r($d); echo "<br>"; print_r($e); echo "<br>";
Output:
The code is as follows:
Warning: fopen(slsl.txt) [function.fopen]: failed to open stream: No such file or directory in E:\mywww\yangtest\base1.php on line 6 array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(32) [3]=> int(322) [4]=> int(3433) [5]=> array(3) { [0]=> int(32) [1]=> int(232) [2]=> int(23232) } } int(1234) string(11) "alsdfl;asdf" string(1) "a" bool(false) array ( 0 => 1, 1 => 1, 2 => 32, 3 => 322, 4 => 3433, 5 => array ( 0 => 32, 1 => 232, 2 => 23232, ), ) 1234 'alsdfl;asdf' 'a' false Array ( [0] => 1 [1] => 1 [2] => 32 [3] => 322 [4] => 3433 [5] => Array ( [0] => 32 [1] => 232 [2] => 23232 ) ) 1234 alsdfl;asdf a
Now you can see the effect. Note that the last one is not that I didn’t paste it over, but that it didn’t display anything in the first place.
The above is the detailed content of What is the difference between the three functions var_dump, var_export and print_r in php?. For more information, please follow other related articles on the PHP Chinese website!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

A dump file usually refers to a binary file, also known as a dump file or core dump file. This kind of file is generated by the computer system when it encounters a serious error or abnormal situation. It is used to store the status, stack, registers, memory images, logs and other information of the system or application.

'Therequestedmoduledoesnotprovideanexportnamed'Error appears in VueCli – how to solve it? During the development of the Vue project, we may encounter the error message 'Therequestedmoduledoesnotprovideanexportnamed'. This error message usually appears when introducing third-party components

The difference between export and export default is that the export keyword is used to export one or more variables, functions, or classes, while the export default keyword is used to export a default variable, function, or class. In other modules, you can use the import keyword to import these exported variables, functions, or classes.

In computers, dump means "dump" in Chinese, which generally refers to exporting and dumping data into files or static forms, that is, saving dynamic (volatile) data into static data (persistent data). There is no need to dump data like programs that are originally stored in storage media (such as hard disks).

The printscreen key is on the arrow keys of the keyboard device, with the words "prtsc sysrq" on it, and is located to the right of f12. If there is no button with the word "prtsc sysrq", you can find "fn" and "insert(prt sc)", click "fn" first, and then click "insert(PRT sc)" to realize the printscreen screenshot function.

As the Linux operating system becomes more and more popular on the server side, data backup and recovery become more and more important. Backups ensure that data can be recovered in the event of system problems or data loss. This article will introduce how to back up and restore a Linux server. Backup Linux server 1. Full disk backup Full disk backup is to back up the entire hard disk and back up the file system contents (operating system, data, configuration files) while the entire directory structure remains unchanged, so that it can be restored to an almost identical state. Use the dd command to perform a full disk backup:

Python is a simple and easy-to-learn high-level programming language that is widely used in data analysis, artificial intelligence, web development and other fields. In Python, print is a commonly used function used to output results or debugging information on the screen. This article will introduce the usage of the print function in detail and provide specific code examples to help readers better master it. First, the print function can accept multiple parameters and print them to the screen. These parameters can be strings, integers, floating point numbers, etc., or even variables,

Python is a popular programming language designed to make computer programming simpler and easier to understand. In Python, using the print function to output text to the console is a basic task. In this article, we'll introduce Python's print function, explore its capabilities and usage examples, and provide code examples to help you better understand how to use the function. Python's print function is a built-in function used to output text and the value of a variable. Its syntax is very simple. You just need to
