riviraz
riviraz

Reputation: 479

How to reverse this php code "pack("L", 1000);"?

I have a code that look like this:

echo bin2hex( pack( "L", 1000 ) );

Which prints: e8030000

Now, having only e8030000, how can I reverse it back to the int 1000 ?

UPDATE:

found the answer: unpack( "L", ( pack( "H*", 'e8030000' ) ) );

Upvotes: 2

Views: 684

Answers (1)

riviraz
riviraz

Reputation: 479

Answer: unpack( "L", ( pack( "H*", 'e8030000' ) ) );

Upvotes: 1

Related Questions