I just want to properly translate this
foo.push(("000" + parseInt(foo1.charAt(loc3), 16).toString(2)).slice(-4));
into php.
Anyone can help me?
asked Nov 8, 2011 at 1:32
razorxan
5161 gold badge7 silver badges20 bronze badges
1 Answer 1
$foo[] = substr("000" . decbin(hexdec(substr($foo1, $loc3, 1))), -4);
Untested, but should either work or get you close.
answered Nov 8, 2011 at 1:38
Brad
164k57 gold badges381 silver badges559 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
Yes Barry
I got a parse error again. Try this:
$foo[] = substr("000" . decbin(hexdec(substr($foo1, $loc3, 1))), -4); +1 anyway though because other that that error this looks good!Brad
@mmmshuddup, thank you for your help... I'm not posting on my dev computer. :-D
Yes Barry
:P any time, I know how that goes!
default