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?

1 Answer 1

4
$foo[] = substr("000" . decbin(hexdec(substr($foo1, $loc3, 1))), -4);

Untested, but should either work or get you close.

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!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.