Search Results
Learn how to use the print_r function in PHP to display human-readable information about a variable's contents. Includes syntax, parameters, and examples.
The PHP print_r() function displays information about a variable in a human-readable format.
Jul 11, 2025 · Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
PHP- print_r () Function In this article, we will go over the PHP print_r () function. The print_r () function is a function which can be used to show the contents, or make-up, of an array. Let's say, for example, we create the following array in PHP.
The PHP Variable Handling print_r () function is used to display information about a variable in an understandable format. It is useful for checking the contents of an array or object. This function prints the data in a simple format, including keys and values. It works with a variety of data types, including numbers, texts, arrays, and objects.
Execute print_r Online. Info and examples on print_r PHP Function from Variable handling - Variable and Type Related Extensions
People also ask
What is print_R function in PHP?
How to print a variable in PHP?
How to print an array in PHP?
What is a print_R function in JavaScript?
The print_r () function is a built-in function in PHP that prints a human-readable representation of a variable to the output. It is commonly used for debugging
