title: How to print a page in PHP to print using printer same as window.print() works
body: <p>Actually i want to print the content with below code sample. </p>
  
  <p><code>$html</code> having my all <code>HTML</code> which i want to print without render a View in Browser and without print/show in browser.</p>
  
  <p>I am trying to find a Same method as <code>window.print();</code> works. But need in <code>PHP</code>. I don't want to show all the <code>HTML</code> in Browser.</p>
  
  <p>Is there any method or Trick ?
  Any suggestion can help me lot.
  Thank you.</p>
  
  <p><strong>My Sample Code:</strong></p>
  
  <pre><code>$arr = array('one','two','three','four','five');
  $html = "&lt;div style='background:red;color:black;'&gt;";
  foreach($arr as $value){
      $html .= $value.'&lt;br /&gt;';
  }
  $html .= "&lt;/div&gt;"; 
  
  // print code to print $html content as same as JS window.print() works.
  </code></pre>