导航

2020年11月10日

摘要: <?php function insertion_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = 阅读全文

posted @ 2020-11-10 11:37 玻璃星 阅读(61) 评论(0) 推荐(0) 编辑

2020年11月9日

摘要: <?php function bubble_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = $a 阅读全文

posted @ 2020-11-09 19:58 玻璃星 阅读(54) 评论(0) 推荐(0) 编辑

摘要: <?php function selection_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ $temp = $i; for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$tem 阅读全文

posted @ 2020-11-09 19:32 玻璃星 阅读(55) 评论(0) 推荐(0) 编辑

摘要: <?php function get_file_list($path){ $file_list = scandir($path); foreach($file_list as $v){ //防止无限循环,. ..在windwo操作系统中代表当前文件夹和上级文件夹 if($v '.'||$v '..' 阅读全文

posted @ 2020-11-09 11:38 玻璃星 阅读(70) 评论(0) 推荐(0) 编辑

摘要: 1.冒泡排序 2.选择排序 3.插入排序 4.希尔排序 5.归并排序 6.快速排序 阅读全文

posted @ 2020-11-09 10:39 玻璃星 阅读(101) 评论(0) 推荐(0) 编辑

2020年10月29日

摘要: 作用:移除数组的一部分,并将其替换为其他内容.return array(由提取的元素组成的数组); array_splice (array &$input,$offset,$length = null, $replacement = null)$input array 输入数组$offset int 阅读全文

posted @ 2020-10-29 13:56 玻璃星 阅读(120) 评论(0) 推荐(0) 编辑

摘要: $a = array('key'=>'value','name'=>'Tom');//Array ( [key] => value [name] => Tom ) $a = array(1,2,3);//Array ( [0] => 1 [1] => 2 [2] => 3 ) 阅读全文

posted @ 2020-10-29 13:41 玻璃星 阅读(84) 评论(0) 推荐(0) 编辑

2020年10月27日

摘要: 共同点:PHP和C语言的变量名都会被解析成内存地址。 不同点:PHP不同点引用可以引用同一个地址,C语言变量名和指针一一对应。 阅读全文

posted @ 2020-10-27 13:32 玻璃星 阅读(111) 评论(0) 推荐(0) 编辑

摘要: 数组排序(6个) sort() - 以升序对数组排序 rsort() - 以降序对数组排序 reversal sort) asort() - 根据值,以升序对关联数组进行排序 (associative sort) ksort() - 根据键,以升序对关联数组进行排序 arsort() - 根据值,以 阅读全文

posted @ 2020-10-27 13:27 玻璃星 阅读(40) 评论(0) 推荐(0) 编辑

2020年9月21日

摘要: class classname { function __construct() { echo __METHOD__, "<br/>"; } } function funcname() { echo __FUNCTION__, "<br/>"; } $a = 'classname'; $obj = 阅读全文

posted @ 2020-09-21 13:16 玻璃星 阅读(106) 评论(0) 推荐(0) 编辑