I need to decode a string from an external device via PHP.
This equipment is a crawler that emits information over a period of time for a given host and port. I created a socket that reads the same host and port of the crawler and was able to receive a message. This is the part of the code I am using to display the received values.
socket_listen($webSocket);
$buff = @socket_read(socket_accept($webSocket), 1024, PHP_BINARY_READ);
echo "Numero de dados recebidos: $flgSl \n";
$receiveStrHex = fread($buff);
var_dump($receiveStrHex);
Part of the string received: e7Xðž, ÒYšþøƒçü À? ¸ 0 'P R R h e e e e e e e e e e e e e e e e e e e e e e e e e e À À À À.
I was trying to use the unpack () method but I was not successful, either.
Thank you.