摘要: 遍历文件夹<?phpfunctionfiles($path){foreach(scandir($path)as$line){if($line=='.'||$line=='..')continue;if(is_dir($path.'/'.$line))files($path.'/'.$line);elseecho$path.'/'.$line."\n";}}files('/root/xuechao/php');?> 阅读全文
posted @ 2011-11-25 21:52 Charliee 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 关于字符串的逆序排列,PHP函数strrev()的测试代码如下:header('Content-type:text/html;charset=utf-8'); $str=implode('',range(9,0)); print'<p><strong>Beforereversed:</strong>'.$str.'</p>'; print'<p><strong>Afterreversed:</strong>'.strrev($str 阅读全文
posted @ 2011-11-25 21:51 Charliee 阅读(829) 评论(0) 推荐(0) 编辑