Posted By

frankyfish on 04/12/07


Tagged


Versions (?)



Who likes this?

3 people have marked this snippet as a favorite

mafro
vali29
antpaw


javascript print_r


Published in: JavaScript 



Website Promotion
DIRECTORY
is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


Expand | Embed | Plain Text
  1. function print_r(theObj){
  2. if(theObj.constructor == Array ||
  3. theObj.constructor == Object){
  4. document.write("<ul>");
  5. for(var p in theObj){
  6. if(theObj[p].constructor == Array||
  7. theObj[p].constructor == Object){
  8. document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
  9. document.write("<ul>");
  10. print_r(theObj[p]);
  11. document.write("</ul>");
  12. } else {
  13. document.write("<li>["+p+"] => "+theObj[p]+"</li>");
  14. }
  15. }
  16. document.write("</ul>");
  17. }
  18. }

Report this snippet 

You need to login to post a comment.