去看看javascript呵呵。
window.print()这不是php要干的事情。

解决方案 »

  1.   

    这个你可以配合用js啊,可以用window.open( [sURL] [, sName] [, sFeatures] [, bReplace])打开要打印的页面,然后调用window.print()将该页面打印。不知道适合你不?请参考吧!^_^
      

  2.   

    打印是客户端的事,跟php有啥关系??
      

  3.   

    你在csdn打印的帖子,你能去北京领取吗?呵呵
      

  4.   

    例子:<head>
    <title>打印确认</title>
    <style media="print">
    .noprint { display: none }
    </style>
    </head>
    <body>
    <object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object>
    <script defer>
    function window.onload() {
      //factory.printing.paperSize = "A3"
      factory.printing.header = ""
      factory.printing.footer = ""
      factory.printing.portrait = true
      idPrint1.disabled = false; // enable UI button
      idPrint2.disabled = false;
      idPrint3.disabled = false;
      idPrint4.disabled = false;
      factory.printing.leftMargin = 0
      factory.printing.topMargin = 5
      factory.printing.rightMargin = 5
      factory.printing.bottomMargin = 5
      }
    </script>
    <span style="text-decoration:underline">打印程序的初步研究</span> 
    <div class=noprint>
      <input id="idPrint1" type="button" value="打印本页"
     onclick="factory.printing.Print(false)">
      <input id="idPrint2" type="button" value="页面设置"
     onclick="factory.printing.PageSetup()">
      <input id="idPrint3" type="button" value="打印预览"
     onclick="factory.printing.Preview()">
      <input id="idPrint4" type="button"
     onclick="window.close()" value="关闭窗口">
    </div>
    <br/>
    <table width="720" border="0" cellspacing="0" cellpadding="0" align="center" >
      <tr> 
        <td  bgcolor="#0099ff"> 没事偷着做</td>
    </tr></table></body>
      

  5.   

    http://www.pconline.com.cn/pcedu/empolder/wz/php/10202/36563.html
      

  6.   

    可以将要打印的东西输出成表格 (csv后缀),excel格式的,然后保存到本地端,自己在excel打印就好了