title: How to make web page print friendly using php code?
body: <p>I have a plain dynamic webpage having a report data with unformulated way. I Want to generate a report style data so I want only functionality in printing stage.</p>
  
  <p>Can any one tell me How can I do it?</p>
  
  <p>I tried some of code in  my page</p>
  
  <pre><code>&lt;?php
  if($mode == 'print') $stylesheet = 'tp.css';
      else $stylesheet = 'style.css';
  echo '&lt;link rel="Stylesheet" href="'.$stylesheet.'" type="text/css" /&gt;';
  ?&gt;
  
  &lt;a href="&lt;?php echo $_SERVER['PHP_SELF'] . '?mode=print'; ?&gt;"&gt;Printer friendly version&lt;/a&gt;
  </code></pre>
  
  <p>try to change a style sheet but having different problem. </p>
  
  <p>I acutely required to print my web site page for visitor on <a href="http://www.McaGurus.com" rel="nofollow">McaGurus.com</a></p>
  
  <p>thanks in advance.</p>