摘要: <?phpfunction scan_dir($arr,$lev = 1){ $array=opendir($arr); while (($w = readdir($array) ) !== false) { if ( $w == '.' || $w == '..') { continue; } echo str_repeat('-', $lev) . $w . '<br/>'; if (is_dir($arr . '/' . $w)) { scan_dir($arr . '/' 阅读全文
posted @ 2012-11-23 20:14 风林火山09 阅读(113) 评论(0) 推荐(0) 编辑
摘要: <?phpfunction str_sub($parstr,$substr){ $par_str = strlen($parstr); #父字符串的长度 $sub_str = strlen($substr); #子字符串的长度 用于判断是否已经在父字符串里查找完毕 # 子字符串开始查找的偏移长度 大于 父字符串的长度 就表示已经查找到底部了 $num = 0; $poi = 0; #出现次数累计变量 while ( $poi < $par_str ) { // if (strpos($parstr,$substr,$poi) !==... 阅读全文
posted @ 2012-11-23 20:04 风林火山09 阅读(415) 评论(0) 推荐(0) 编辑