for ($i = 1; $i <= $maxpaikat; $i++){ if (file_exists("paikat/$i.txt"){ if (filesize("paikat/$i.txt) == 0 { echo ""; } } }