不明白php中的inet_pton的返回值是什么?

rosecshly0928 2012-07-27 11:14:17
我看到文档说inet_pton的功能是:
Converts a human readable IP address to its packed in_addr representation
返回值是:
Returns the in_addr representation of the given address。
packed in_addr representation是什么?
我怎么去除返回值或显示返回值呢?
为什么我echo,print_r出来的内容全是乱码呢。
var_dump出来的是
string(16) " @"
string(16) " €"
string(16) " 0"
string(16) " 0 "
string(16) " 0@"
string(16) " 0€"
这些东西
...全文
222 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
rosecshly0928 2012-07-30
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]

IP的大端序字节流。
[/Quote]
能不能具体点呢,谢谢,因为我看不懂。
qq120848369 2012-07-30
  • 打赏
  • 举报
回复
IP的大端序字节流。
rosecshly0928 2012-07-30
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

注意: 本函数未在 Windows 平台下实现。
[/Quote]
已经实现了
Meteorlet 2012-07-27
  • 打赏
  • 举报
回复
in_addr是一个结构体,是二进制的,没有必要显示
  • 打赏
  • 举报
回复
注意: 本函数未在 Windows 平台下实现。

rosecshly0928 2012-07-27
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

in_addr是一个结构体,是二进制的,没有必要显示
[/Quote]
那我怎么显示ip的二进制呢,我是想我直接显示它是不是就显示的ip的二进制呢

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧