title: Display full 1-128 bit decimal to binary using PHP
body: <p>I know this seams to be easy but, I have a question to this particular situation.
  I already know how to convert decimal to binary using PHP, but I want to display
  the full bit sequence, but surprisingly, I don't know how.</p>
  
  <p>the conversion must be like this:</p>
  
  <pre><code>converting 127(decimal) to binary using PHP = 1111111. the bit sequence is 1-128 for every 
  octet(IP Address) so this must output = 01111111 even 128 is not used.
  2nd Example:
  1(decimal) to binary = 01. Want to display the full 1-128 binary sequence even if
  128,64,32,16,8,4,2 is not used it must be like this 00000001 not 01.
  </code></pre>
  
  <p>this is my PHP code:</p>
  
  <pre><code>&lt;?php
  
          $octet1 = $_POST["oct1"];
          $octet2 = $_POST["oct2"];
          $octet3 = $_POST["oct3"];
          $octet4 = $_POST["oct4"];
          echo decbin($octet1) ," ", decbin($octet2) ," ", decbin($octet3) ," ", decbin($octet4);
  
      ?&gt;
  </code></pre>
  
  <p>this only displays the shortened binary just like this:</p>
  
  <pre><code>16 to binary is 10000 or but i want to display this 00010000(Full length)
  </code></pre>
  
  <p>How can I do that?</p>