Print recursive in pre-formatted tags


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. /**
  3.  * Wraps content in <pre> tags. Useful for using with arrays of data.
  4.  *
  5.  * @version 1.0
  6.  * @author Andrew Hart
  7.  *
  8.  * @param string $content The content to wrap in <pre> tags.
  9.  */
  10. function pre_wrap($data)
  11. {
  12. echo '<pre>' . print_r($data, true) . '</pre>';
  13. }
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.