How to convert byte array to integer in php?
<p>I have seen a code that <strong>converts integer into byte array</strong>. Below is the code on <strong>How to convert integer to byte array in php 3</strong> (<a href="http://stackoverflow.com/questions/11544821/how-to-convert-integer-to-byte-array-in-php">How to convert integer to byte array in php</a>):</p>

<pre><code>&lt;?php

$i = 123456;
$ar = unpack("C*", pack("L", $i));

print_r($ar);
?&gt;
</code></pre>

<p>The above code will output:</p>

<pre><code>//output:
Array
(
   [1] =&gt; 64
   [2] =&gt; 226
   [3] =&gt; 1
   [4] =&gt; 0
)
</code></pre>

<p>But my problem right now is how to <strong>reverse</strong> this process. Meaning converting from <strong>byte array into integer</strong>. In the case above, the output will be <strong>123456</strong></p>

<p>Can anybody help me with this. I would be a great help. Thanks ahead.</p>
