socket_read使响应名称服务器可读

时间:2012-12-03 13:16:14

标签: php hex ascii

如何从名称服务器中获取响应?

如果我的回答是:
0x01, 0x01, 0x85, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x02, 0x6e, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x04, 0xad, 0xc2, 0x20, 0x77, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x04, 0xad, 0xc2, 0x20, 0x7f, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x04, 0xad, 0xc2, 0x20, 0x78, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05, 0x46, 0x00, 0x00, 0x10, 0x03, 0x6e, 0x73, 0x33, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x0c, 0x0b, 0x76, 0x3d, 0x73, 0x70, 0x66, 0x31, 0x20, 0x2d, 0x61, 0x6c, 0x6c, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x0c, 0x00, 0x0a, 0x05, 0x61, 0x73, 0x70, 0x6d, 0x78, 0x01, 0x6c, 0xc0, 0x5b, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, 0x00, 0x1e, 0x04, 0x61, 0x6c, 0x74, 0x32, 0xc0, 0x8d, 0xc0, 0x0c, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x22, 0xc0, 0x57, 0x09, 0x64, 0x6e, 0x73, 0x2d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0xc0, 0x5b, 0x00, 0x16, 0xf7, 0x0a, 0x00, 0x00, 0x03, 0x84, 0x00, 0x00, 0x03, 0x84, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 0x3c, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, 0x00, 0x32, 0x04, 0x61, 0x6c, 0x74, 0x34, 0xc0, 0x8d, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05, 0x46, 0x00, 0x00, 0x06, 0x03, 0x6e, 0x73, 0x32, 0xc0, 0x5b, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05, 0x46, 0x00, 0x00, 0x06, 0x03, 0x6e, 0x73, 0x34, 0xc0, 0x5b, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, 0x00, 0x28, 0x04, 0x61, 0x6c, 0x74, 0x33, 0xc0, 0x8d, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05, 0x46, 0x00, 0x00, 0x06, 0x03, 0x6e, 0x73, 0x31, 0xc0, 0x5b, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, 0x00, 0x14, 0x04, 0x61, 0x6c, 0x74, 0x31, 0xc0, 0x8d

那么这是我的ascii输出
.............google.nl..............,.... w.........,.... ..........,.... x........F....ns3.google.com..........,...v=spf1 -all.........X... .aspmx.l.[.........X.....alt2...........<.".W.dns-admin.[... ...............<.........X...2.alt4..........F....ns2.[........F....ns4.[.........X...(.alt3..........F....ns1.[.........X.....alt1..

这是我从其中一个谷歌名称服务器获取的信息。我怎样才能用php读取它?

0 个答案:

没有答案