Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.



Add comment:
Name:
Email:
Comment: *
(Use BBcode - No HTML)


You MUST answer this simple math equation - to prevent spammers: 6 + 7 =  


how can I output my php arrays in a readable html format using print_r?

Last updated: 06/30/2009

I just use this simple function to wrap the call to print_r.  This displays your array in a good debugging format:

 

<?
function html_print_r($arr) {
  ?><pre><?
  print_r($arr);
  ?></pre><?
}
?>

 





Powered by KnowledgebasePublisher 1.1
Superb Internet
Content provided by Roberts WebForge, Inc.