title: How to convert integer to byte array in php
body: <p>how would I convert an integer to an array of 4 bytes?</p>
  
  <p>Here is the exact code I want to port (in C#)</p>
  
  <pre><code>int i = 123456;
  byte[] ar = BitConverter.GetBytes(i);
  // ar will contain {64, 226, 1, 0}
  </code></pre>
  
  <p>How would I do the exact same thing in PHP ?</p>