Php Basics-application of var_dump functions

Source: Internet
Author: User
Php Basics -- var_dump function var_dump (PHP3 & gt; 3.0.5, PHP4) var_dump? --? Print the void of the variable description? Var_dump? (Mixedexpression [, mixedexpression [,...]) This function displays the structure information about one or more expressions, including the expression type and value. php Basics-var_dump function usage

Var_dump

(PHP 3> = 3.0.5, PHP 4)

Var_dump? --? Print information about variables

Description void?Var_dump? (Mixed expression [, mixed expression [,...])

This function displays the structure information about one or more expressions, including the expression type and value. The array recursively expands the value and displays its structure through indentation.

Tip :?To prevent the program from directly outputting the results to the browser, you can use the output-controlfunctions function to capture the output of the function and save them to?String? Type.

Can you compare them?Var_dump ()? And?Print_r ().

?

Example 1 .?Var_dump ()? Example


$? = Array (1 ,? 2, array ("",? "B ",? "C "));
Var_dump? ($ );

/* Output:
Array (3 ){
?? [0] =>
?? Int (1)
?? [1] =>
?? Int (2)
?? [2] =>
?? Array (3 ){
???? [0] =>
???? String (1) ""
???? [1] =>
???? String (1) "B"
???? [2] =>
???? String (1) "c"
??}
}

*/

$ B? =? 3.1;
$ C? =? TRUE;
Var_dump ($ B, $ c );

/* Output:
Float (3.1)
Bool (true)

*/
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.