<?php
//遍历文件
$files = scandir('music');
$i = 1;
foreach ($files as $key => $value) {
if ($value !='.' && $value !='..') {
echo $i.'-'.$value."</br>";
$i++;
}
}
显示结果
<?php
//遍历文件
$files = scandir('music');
$i = 1;
foreach ($files as $key => $value) {
if ($value !='.' && $value !='..') {
echo $i.'-'.$value."</br>";
$i++;
}
}
显示结果