Its quick and dirty, but great for debugging the contents of large arrays and objects. This is an alternative for printing arrays. It bolds array values. Heres a simple fix for anyone who is having the same problem as I did. This will output your text properly for viewing through the browser instead of the browser's "view source" or CLI. I have written a nice debugging function. This function handles arrays beautifully. Yet I had some classes where I just wanted the values coming out of the database, not all the other crap.
If your class has an toArray function, that one will be called otherwise it will return the object as is. For those of you needing to print an array within a buffer callback function, I've created this quick function.
It simply returns the array as a readable string rather than printing it. Improve this question. Gordon k 69 69 gold badges silver badges bronze badges.
Atif Atif Add a comment. Active Oldest Votes. Improve this answer. Gordon Gordon k 69 69 gold badges silver badges bronze badges. Show 3 more comments. Felix Kling Felix Kling k gold badges silver badges bronze badges. Sarfraz Sarfraz k 70 70 gold badges silver badges bronze badges. Ahmad Ahmad 4, 8 8 gold badges 26 26 silver badges 39 39 bronze badges.
I just wrote this function to output an array as text: Should output nicely formatted array. This script was created for internal use. This is not fool proof and should be used with trusted data only. Would be near impossible to do that with serialized output Not the cleanest function but it gets the job done.
Related Articles. Table of Contents. Improve Article. Save Article. Like Article. Example 1 :. File Name: ". File Type: ". File Size: ". Asked 8 years, 9 months ago. Active 1 year, 7 months ago.
Viewed 50k times. Improve this question. Christopher JB Luck. Can you show us the HTML for your file upload fields? Which array would be this by the way? Add a comment. Active Oldest Votes. Improve this answer.
0コメント