摘要: $a=array('3','8','1','4','11','7');print_r($a);$len = count($a);//从小到大for($i=1;$i<$len;$i++){for($j=$len-1;$j>=$i;$j--)if($a[$j]<$a[$j-1]){//如果是从大到小的话 阅读全文
posted @ 2016-04-22 15:57 secretgao 阅读(87) 评论(0) 推荐(0) 编辑
摘要: function kuaisu($arr){ $len = count($arr); if($len <= 1){ return $arr; } $key = $arr[0]; $left_arr = array(); $right_arr = array(); for($i=1; $i<$len; 阅读全文
posted @ 2016-04-22 15:56 secretgao 阅读(93) 评论(0) 推荐(0) 编辑
摘要: $a='大客户疯狂的顺口溜'; function substr_utf8($string,$start,$length){ return join("",array_slice(preg_split("//u",$string,-1,PREG_SPLIT_NO_EMPTY),$start,$leng 阅读全文
posted @ 2016-04-22 15:53 secretgao 阅读(756) 评论(0) 推荐(0) 编辑
摘要: foreach ($result as $key=>$val){ //中文字符串截取 if(mb_strlen($val['message'], 'utf8') > 5){ $result[$key]['message_zh_cn']=mb_substr($val['message'], 0, 5, 阅读全文
posted @ 2016-04-22 15:52 secretgao 阅读(142) 评论(0) 推荐(0) 编辑
摘要: $empty1=array(""," ","\t","\n","\r"); $empty2=array("","","","",""); foreach ($_POST as $key=>$val){ //去除空格 $arr[$key]=str_replace($empty1,$empty2,$va 阅读全文
posted @ 2016-04-22 15:51 secretgao 阅读(271) 评论(0) 推荐(0) 编辑
摘要: $arr = array( 25 =>array( 'mid' => '28838', 'invest_money' => '1196000', 'rm_id' => '157733', ), 27 =>array ( 'mid' => '28838', 'invest_mon 阅读全文
posted @ 2016-04-22 15:48 secretgao 阅读(130) 评论(0) 推荐(0) 编辑
摘要: $arr=Array ( 'contract_type' => Array ( '0' => 0, '1' => 0, '2' => 0,'3' => 0, ), 'use_contract' => Array ( '0' => 7, '1' 阅读全文
posted @ 2016-04-22 15:44 secretgao 阅读(310) 评论(0) 推荐(0) 编辑