跳转到主内容
趣航编程网 - 趣学编程,启航技术之路!

PHP简略源码学习

PHP简单源码学习 书上的源代码,好多个,每个都要敲就烦死了,上网扣了段遍历文件的代码:http://www.web589.com/posts/808.html作者写得不错的嘛,注释非常详细

"; function directory($dir){ $dp = opendir($dir); while($file = readdir($dp)){ if($file !="." && $file !=".."){ $path=$dir. "/". $file; /* 取得目录路径 */ if(is_dir($path)){ /* 判断是否有子目录 */ directory($path); /* 函数递归调用 */ echo "

"; } else{ printf(''.$path.'

'); } } } closedir($dp); } directory("."); ?>
$number = "5"; # $number is a string $sum = 15 + $number; # Add an integer and string to produce integer print("$sum\n");

相关文章