Snippets tagged “print-r”
6 snippets use this tag.
- How can I print all the values of an array?PHP
In PHP, you can use a foreach loop to iterate through an array and print each value.
- How do I print all POST results when a form is submitted?PHP
To print all the POST results when a form is submitted with PHP, you can use the print_r($_POST) function.
- How to output (to a log) a multi-level array in a format that is human-readable?PHP
There are a few different ways you can output a multi-level array in a human-readable format, depending on what you mean by "human-readable" and what you want to achieve.
- How to print a debug log?PHP
To print a debug log in PHP, you can use the echo function to output a string to the web page or the print_r function to output the contents of a variable.
- How to print all information from an HTTP request to the screen, in PHPPHP
In PHP, you can use the $_SERVER superglobal array to access information about the current HTTP request.
- How to Use echo, print, and print_r in PHPPHP
While working with PHP, every developer should know how to use echo, print, as well as print_r. Read our snippet to learn about these crucial parts of PHP.