php代码执行的一些操作
php列目录
- 利用glob函数The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells.
1
foreach (glob("./*") as $filename) { echo $filename."<br>"; }
- 利用DirectoryIterator对象
1
$d=new DirectoryIterator("glob:///var/www/html/f*");var_dump($d);
- 使用scandir()
1
$dir="./";$file=scandir($dir);print_r($file);
php读文件
- highlight_file()
1
2$a = highlight_file('flag');
echo $a; - show_source()
1
show_source("flag.txt");