fajnykamil
5.02.2008, 15:44:48
jak zrobic zeby PHP liczylo pliki w folderze i zapisywalo ich liczbe do zmiennej
potreb
5.02.2008, 16:08:32
<?php
function countFiles($strDirName)
{
if ($hndDir = opendir($strDirName)) {
$intCount = 0;
while (false !== ($strFilename = readdir($hndDir))) {
if ($strFilename != "." && $strFilename != "..")
{
$intCount++;
}
}
}
else
{
$intCount = -1;
}
return $intCount;
}
echo countFiles
("C:Temp"); ?>
specialplan
6.02.2008, 00:50:32
DirectoryIterator - poczytaj w manualu. Pzdr.