title: Print to Zebra printer in php
body: <p>Looking for the proper code to print from php web page to a zebra IP printer using RAW port 9100. Does anyone know if this is possible? I need to send a string in ZPL formatted output direct to ZM400 label printer. I've searched high and low, the closest I've found is this: <a href="https://stackoverflow.com/questions/4956143/print-directly-to-network-printer-using-php?rq=1">Print directly to network printer using php</a></p>
  
  <p>It seems very close to what I need, but when my php page hits that code, it doesn't do anything. Here's the code I used:</p>
  
  <pre><code>&lt;?php 
       $handle = printer_open('\\\\192.168.2.206:9100\\'); 
       printer_set_option($handle, PRINTER_MODE, "RAW");
       printer_write($handle, "TEXT To print"); 
       printer_close($handle);
  ?&gt;
  </code></pre>