0

A tracking device is sending me live tracking information in bytes format. The size of the bytes is 70 bytes. Its in multibyte format and not single byte.

The integration document suggests the valid format of input as:

4D434750007E02090008581CD81F04029E000B01C2040020764FF37B00480800000000000000A0CC0004020C422C140839B1F602E74900001D000000D50C2C2012190CDD0794

The size of the string is 140 characters and the byte size as per doc is 70 bytes.

I have done the coding using substr expecting the data to come in this format.

But when i integrated the device its not sending me in this format and substr is not giving any result.

the strlen returns 0

If i save the input to a db column of varchar(200), it shows MCGP à^uutÚM£g... in phpmyadmin at the column.

I have written a listner using How to listen to a TCP port using PHP? example and is working fine.

But i am stuck in handling the bytes input and converting to a HEX string as shown in the example above.

If i am to extract each byte (for example the 17th and 18th Byte from the string, how do I do it)

Please help

Community
  • 1
  • 1
  • if the strlen returns 0, it myst be an empty string in mysql. show the code? – Sanya_Zol Feb 15 '14 at 18:35
  • my mistake - it returns 70 but when saved in DB shows the above characters i need the ability to parse it. i case paste the parsing code but unable to access the bytes – user3314040 Feb 15 '14 at 19:55

0 Answers0