PHP: Show content of array
Question by Guest | 2014-02-08 at 22:04
At the moment, I am working at a giant PHP script in which I am losing slowly but surely the overview.
For this reason, I've started to visualize my script a little bit by showing the contents of some variables with the PHP echo function, in order to understand what there is happening at all.
This method is working very good for integer and string vaiables. The only thing making problems are extensive arrays. So, is it somehow possible to echo or show an array in PHP in a simple and fast way? I do not want to go through the array using a foor loop because this is very inconvenient.
Related Topics
PHP: Remove all empty elements from string array
Tip | 0 Comments
JavaScript: Create and Use Arrays
Info | 0 Comments
Send Form Input as an Array to PHP Script
Tip | 0 Comments
Lazarus: Load File as Byte Array and save Byte Array as File
Tutorial | 0 Comments
PHP: Write array to individual Variables
Tutorial | 0 Comments
PHP: Fill Array with Sequence of Numbers or Characters
Tutorial | 0 Comments
JavaScript: Sort Array of Numbers
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Just use the function print_r() from PHP.
This function outputs the content of an array:
The output could look something like this:
Of course, you can also get the same result using loops, but in fact this is a very inconvenient way if you only want to look in just one variable.
2014-02-09 at 10:51