I need to send hex values to php socket but server socket receive ascii type values. Is there any possible to send hex values? if i send '0x01' this hex values but server side receive same '0x01' value but ASCII type. Can anyone send the solution for that. Is possible to send hex value in php socket without any type conversion?
That is exactly what you send it: an ASCII representation of hexadecimal data.
In PHP, you can convert that hexadecimal string to a number using hexdec()
which is defined as follows in the PHP manual:
number hexdec ( string $hex_string )