![]() |
分割字符串并取出指定的字符
$ip="192.168.1.128";
$ips=explode(".",$ip); //将$ip中保存的ip地址按"."分割成一个数据,然后赋值给数据$ips print_r($ips); --- 目的, 取出ip和D段 $ip="192.168.1.128"; list($a,$b,$c,$d)=explode(".",$ip); // list(,,,$d)=explode(".",$ip); list()将$ip保存的数据转成变量 echo $d; 使用数组的内部指针控制函数 next(数组); prev(数组); reset(数组); end(数组); cureent(数组); |
| All times are GMT +8. The time now is 01:19 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.