PHP whitespace before and after a given string need to be considered for byte processing
<p>I need to send 8 bytes to a given server in my socket.</p>

<p>The string should have 8 bytes with 3 characters and 5 empty spaces. However, <code>PHP</code> always strips out the spaces. How could i go about this?</p>

<pre><code>&lt;?php
   $SERVICE_NAME = "PXA     "; //8 bytes
   $OPT = "CODE5";

   $sendBytes = $SERVICE_NAME . $OPT;

   //i need sendBytes to go as PXA     CODE5
   //instead it goes as PXA CODE5.     

   $mySocket-&gt;send($sendBytes);
?&gt;
</code></pre>