Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] wielkość pliku
-xeros-
post
Post #1





Goście







Witam,
Mam na serwerze np. jakis_plik.zip i chcialbym np sprawdzic ile ten plik zajmuje miejsca np. w mb?

Jest jakas komenda ktora mi to sprawdzi ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kacpereczek
post
Post #2





Grupa: Zarejestrowani
Postów: 32
Pomógł: 0
Dołączył: 15.08.2008
Skąd: Tetaumatawhakatangihangak
oauaotamateaurehaeaturipu
kapihimaungahoronukupokai
whenuaakitanarahu

Ostrzeżenie: (0%)
-----


Zrobiłem wszystko tak:

  1. <?
  2. $files = array('../gallery/comments/01.txt', '../gallery/comments/02.txt','../gallery/comments/03.txt', '../gallery/comments/04.txt', '../gallery/comments/05.txt', '../gallery/comments/06.txt', '../guestbook/data.txt');
  3.  
  4. foreach ($files as $file) 
  5. {  
  6. $size = filesize($file);
  7. $size_mb = ($size/1024)/1024;
  8. $round = round($size_mb,2);
  9. $format = number_format($size, 2, ',', ',');
  10. echo $filename . ': ' . $round . ' megabajty';
  11. echo "<br>";
  12. }
  13. ?>


I wyświetla mi się tylko to:

Cytat
: 0 megabajty
: 0 megabajty
: 0 megabajty
: 0 megabajty
: 0 megabajty
: 0 megabajty
: 0 megabajty


Proszę o pomoc...
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 16:14