I have a a php string:
e.g. df299cc4cda279e4d7344b42a8006d94488c753f
This is representing a 20 bit HEX output. How would I select the n’th byte? For example if I select the 3rd one it should return 9c.
Thanks.
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.
Or you may want to convert the string to actual binary using
hex2bin, then echo the index[2]of the string, possibly converting back to hex for output.