How can I solve the problem of whether socket_write in php can directly send hexadecimal data?

Source: Internet
Author: User
In php, can socket_write directly send hexadecimal data? if the hexadecimal data is directly sent, he will first Convert hexadecimal to hexadecimal and then split the string, calculate the split string in hexadecimal notation and send the code as follows: $ str = 0xFA; & nbsp; socket_write ($ connection, $ str ); the data obtained through the packet capture tool is whether socket_write in php 3 can directly send hexadecimal data.
If the hexadecimal data is directly sent, it will first convert the hexadecimal data into a hexadecimal data, then split the string, calculate the hexadecimal string after the split, and finally send the data, the code is as follows:

$ Str = 0xFA;
Socket_write ($ connection, $ str );

The data obtained through the packet capture tool is 32 35 30, for example:



Is there a way to directly send hexadecimal data, that is, the data I captured through the packet capture tool is FA?

------ Solution --------------------
Yes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.