I’ve read two bytes from a binary file into $data and now need to perform a bitwise and.
But when I do
if (($data & "\x100") != 0) {
I get the error Argument “@\0” isn’t numeric in numeric ne (!=)
Am I supposed to convert $data first?
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.
Why are you using strings for binary operations?
Use
($data & 0x100) != 0and, if necessary, convert$datato a number.