How can we convert a 4-byte number into hexadecimal notation?

Source: Internet
Author: User
How can we convert a 4-byte number into hexadecimal notation? I only know the dechex function, but the transfer is
Echo dechex (1407401322869 );

Afa7e975

The result of the four-byte calculator is 147afa8260.

How can I implement it using PHP?


Reply to discussion (solution)

What is your calculator?
It should be 147AFA7E975

Echo base_convert (1407401322869, 10, 16); // 147afa7e975

You have a problem with the calculator.

No, moderator. I didn't test it.
Test

Echo base_convert (1407401322869, 10, 16); // displayed as cccdc8f1ea8?

Thank you for your help.

I wrote an error in the question. The result is 147afa7e975.
But when I use base_convert, the result is cccdc8f1ea8. why?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.