Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use print_r function in php

Shulou Source: shulou.com Published: 2022-06-01 03:00:57 09月22日 Update

This article mainly introduces how to use the print_r function in php, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.

Print_r function

The print_r function prints easy-to-understand information about variables.

Syntax:

Mixed print_r (mixed $expression [, bool return])

If the variable is string, integer or float, it will output its value directly, and if the variable is an array, it will output a formatted array that is easy to read, that is, the format corresponding to key and value.

The same for object objects.

Print_r has two parameters, the first is a variable, the second can be set to true, if set to true, a string is returned, otherwise a Boolean value TRUE is returned.

Tags: Functions variables articles arrays formats outputs two that is values information interests parameters at the same time characters strings objects Boolean more friends knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi MariaDB Redmi NVidia