- php
- print_r
8 июля 2008, 11:18 более года назад
JavaScript: print_r (array and object dump)
function print_r(theObj, str){ if(theObj.constructor == Array || theObj.constructor == Object){ str += ("<ul>"); for(var p in theObj){ if(theObj[p].constructor == Array||theObj[p].constructor == Object){ str += ("<li>["+p+"] => "+typeof(theObj)+"</li>"); str += ("<ul>"); str = print_r(theObj[p], str); str += ("</ul>"); } else { str += ("<li>["+p+"] => "+theObj[p]+"</li>"); } } str += ("</ul>"); return str; } }