1

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

1 Answer 1

4
$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
Sign up to request clarification or add additional context in comments.

3 Comments

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!
@mmmshuddup, thank you for your help... I'm not posting on my dev computer. :-D
:P any time, I know how that goes!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.