Convert a javascript piece of code into php
<p>I just want to properly translate this</p>

<pre><code>foo.push(("000" + parseInt(foo1.charAt(loc3), 16).toString(2)).slice(-4));
</code></pre>

<p>into php.</p>

<p>Anyone can help me?</p>
