title: how to write a zpl code inside a php script and how to send it to a zebra printer for printing
body: <p>I want to print a bar code on a label using zebra label printer.Barcode printer model is Zebra GK420d . Sticker print area is 5 cm by 10 cm.I want to do it from a php script.By googling I found some examples and implemented in this way</p>
  
  <pre><code>$barcode = "sometext";
  $labelcode =&lt;&lt;&lt;AAA
  ^XA
  ^FO100,75
  ^BCN, 100,Y, N,
  ^FD$barcode^FS
  ^XZ
  AAA;
  
  file_put_contents('/dev/lpt1',$labelcode);
  </code></pre>
  
  <p>Will it work when i connect the printer and test?What are the settings that i have to apply for this zebra printer in order to print.I have no idea on zebra printers settings.And also file_put_contents will copy the code to the printer by using the port.how to find the port of the printer that is connected to the system.if it by usb what info we have to pass to the file_put_contents.Please suggest the zebra printing process </p>