Using ltrim(); to take away '0's from the start of my users input
<p>I ask for a user to input 4 numbers or letter from 1 - 9 and a-f. </p>

<p>i then take these numbers and letters and <code>str_replace</code> them with 4 byte values. </p>

<p>So if the user inputs <code>00FF</code>, the value would be <code>0000 0000 1111 1111</code>, as <code>0000</code> is the 4 byte value of <code>0</code> and <code>1111</code> is the 4 byte value of <code>F</code>. </p>

<p>I want to get rid of any leading <code>'0's</code> from the total collection of 4 byte values.</p>

<p>I have tried using the below code to get rid of the 0's from the start of it.</p>

<pre><code>$hexvalue2 = ltrim($hexvalue,'0');
echo $hexvalue2;
</code></pre>

<p>However, this is not working, when looking at PHP.net as far as my knowledge goes this seems correct, but obviously its not.</p>

<p>Can anyone tell me where i am going wrong please? or perhaps suggest an alternative?</p>

<p>Thank you</p>
