摘要: 比如 :$a=array('111','222','333','444','555');$b=array('111','333','666','999');我要计算出 $b 在 $a 的基础上删除了谁?(222、444、555)还要计算出 $b 在 $a 的基础上增加了谁?(666、999)另外还有 $b 跟 &a 都有谁是相同的?(111、333)这怎么用PHP实现计算呢?我要计算出 $b 在 $a 的基础上删除了谁?(222、444、555 阅读全文
posted @ 2014-03-19 17:19 thekingofreturn 阅读(369) 评论(0) 推荐(0) 编辑
摘要: php 自带函数 1.strlen:获取字符串的总长度 2.substr:截取字符串示例:$Str=",1,2,3,4,5,6";目标:把第一个逗号干掉,剩下的部分转换为数组。用到的函数strlen、substr、explode(把字符串转为数组,还能联想到数组转换成字符串函数implode)$Str=substr($Str,1,strlen($str)-1);//1代表开始截取的位置索引,一般索引从0开始,那1就是从第二个字符开始了,第三个参数,截取的长度。结果:1,2,3,4,5,6$Arr=explode(',',$Str);print_r($Arr) 阅读全文
posted @ 2014-03-19 17:18 thekingofreturn 阅读(245) 评论(0) 推荐(0) 编辑
摘要: AppleWebKit.*Mobile 说明:点 是任意字符* 是取 0 至 无限长度.* 就是匹配AppleWebKit xxxxxxxxxxxx(任意字符)Mobile手机浏览器User-Agent信息 3个例子如下:2345浏览器Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Galaxy Nexus Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/5.0 Mb2345Browser/4.0 Mobile Safari/534.30遨游浏览器Mozilla/5.0 (Linu 阅读全文
posted @ 2014-03-19 11:25 thekingofreturn 阅读(710) 评论(0) 推荐(0) 编辑