企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
ip方法支持检测是否是正确的IP地址。支持IPv4和IPv6。 如果想要单独检测IPv4格式IP请使用Validator::ipv4() 如果想要单独检测IPv6格式IP请使用Validator::ipv6() 格式: ~~~ Validator::ip(值) Validator::ipv4(值) Validator::ipv6(值) ~~~ 用法: ~~~ Validator::ip('127.0.0.1'); // true Validator::ipv4('127.0.0.1'); // true Validator::ipv6('127.0.0.1'); // false ~~~ ~~~ Validator::ip('127.0.0.256'); // false Validator::ipv4('127.0.0.256'); // false Validator::ipv6('127.0.0.256'); // false ~~~ ~~~ Validator::ip('::ffff:192.168.89.9'); // true Validator::ipv4('::ffff:192.168.89.9'); // false Validator::ipv6('::ffff:192.168.89.9'); // true ~~~ ~~~ Validator::ip('0000:0000:0000:0000:0000:0000:c0a8:5909'); // true Validator::ipv4('0000:0000:0000:0000:0000:0000:c0a8:5909'); // false Validator::ipv6('0000:0000:0000:0000:0000:0000:c0a8:5909'); // true ~~~ ~~~ Validator::ip('::'); // true Validator::ipv4('::'); // false Validator::ipv6('::'); // true ~~~