php-output tagged requests and articles

Categorized request examples and articles tagged with [php-output] keyword
How to print variables in PHP using print_r?
The print_r function in PHP allows you to print the contents of variables, arrays, and objects in a human-readable format. Primary print_r is used for debugging since it lets you visually inspect data structures' contents. To use print_r, pass the variable you want to inspect as the first argument to the function. If you want the output returned as a string rather than printed to the screen, specify true as the second argument to the function. In this PHP print_r example, we print the contents of a variable on the screen and save it to a string. Click Execute to run the PHP print_r example online and see the result.