I need help converting numbers (string) to int8 or uint8 using PHP.
Example: number 10 should be 0A
How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What it seems like you want to do has nothing to do with signed or unsigned integers, you’re just converting an integer to its hexadecimal representation. In PHP, that can be done with
dechex.dechex(10)will return 0xA.