02 2016 档案

摘要:方法一: 1 function King($arr, $count){ 2 $i = 1; 3 while(count($arr) > 1){ 4 if($i%$count == 0){ 5 unset($arr[$i-1]); 6 }else{ 7 array_push($arr, $arr[$i 阅读全文
posted @ 2016-02-24 12:09 hell0x 阅读(162) 评论(0) 推荐(0)
摘要:1 <?php 2 function tree($arr, $pid=0, $level=0){ 3 static $list = array(); 4 foreach($arr as $v){ 5 if($v['parent_id'] == $pid){ 6 $v['level'] = $leve 阅读全文
posted @ 2016-02-19 14:55 hell0x 阅读(309) 评论(0) 推荐(0)
摘要:1 <?php 2 function my_scandir($dir){ 3 $files = array(); 4 if(is_dir($dir)){ 5 if($handle = opendir($dir)){ 6 while(($file = readdir($handle)) !== fal 阅读全文
posted @ 2016-02-19 14:40 hell0x 阅读(161) 评论(0) 推荐(0)
摘要:1 <?php 2 $conn = mysql_connect("localhost", "root", "") or die("连接错误"); 3 mysql_select_db("test"); 4 mysql_query("set names utf8"); 5 6 //获取总数量 7 $sq 阅读全文
posted @ 2016-02-15 15:55 hell0x 阅读(137) 评论(0) 推荐(0)