razorxan
razorxan

Reputation: 516

Convert a javascript piece of code into php

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?

Upvotes: 1

Views: 77

Answers (1)

Brad
Brad

Reputation: 163291

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

Untested, but should either work or get you close.

Upvotes: 4

Related Questions