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.
print_r () displays information about a variable in a way that's readable by humans. print_r (), var_dump () and var_export () will also show protected and private properties of objects with PHP 5. Static class members will not be shown. Remember that print_r () will move the array pointer to the end. Use reset () to bring it back to beginning.
Aug 19, 2022 · The print_r() function is used to print human-readable information about a variable.
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.
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?
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.
