Skip to content
Advertisement

Tag: byte

How to convert Hex to binary in PHP?

I’m trying to send 0x01 HEX as Byte using the socket_write($socket, XXXX , 1); function. There is part of documentation: “…If yes, server will reply to module 0x01, if not – replay 0x00. Server must send answer – 1 Byte in HEX format.” Answer There are multiple alternatives: When using the pack() function, the string argument to the H* format

Advertisement