PHP 操作串口或socket时以16进制发送 "FD FF 01 0F" 16进制字符串写法: "\xFD\xFF\x01\x0F" hex2bin(preg_replace('# #', '', "FD FF 01 0F"))