网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站设计 > PHP
User Name
Password
 
FAQ Members List Calendar Cheap Glasses Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1   IP: 114.238.173.212
Old 2014-12-26, 03:34 PM
Karlee Karlee is offline
初级会员
 
Join Date: 2011-10-04
Posts: 1
Karlee 现在声名狼藉
Default 分割字符串并取出指定的字符

$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(数组);
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 03:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.