title: Using <pre> in function in PHP
body: <p>I want to be able to print arrays and json results with php using html <code>&lt;pre&gt;</code> tag. </p>
  
  <p>Today - everytime I do this I do like this</p>
  
  <pre><code>echo '&lt;pre&gt;';
  print_r($value_to_print);
  echo '&lt;pre&gt;';
  </code></pre>
  
  <p>Now finally understanding a bit more about functions I realize I soon need to say goodbye to copy - paste. Anyhow - back to the problem. I want to make a function out of the above but I can't get it to work.</p>
  
  <pre><code>function prefunc($value_to_print){
  
  $ret = '&lt;pre&gt;'; 
  $ret .= print_r($value_to_print); 
  $ret .= '&lt;/pre&gt;';
  
  return $ret;
  }
  
  prefunc($print_this_within_pre_tags);
  </code></pre>
  
  <p>New to functions - please help me get rid of copy paste and sloppy code :D </p>
  
  <p>Thank you</p>