Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,104 questions

40,777 answers

573 users

How to get the size of a file in PHP

3 Answers

0 votes
$filename = 'd:\\data.txt';

echo filesize($filename) . " bytes";
  
/*
run:

5 bytes

*/

 





answered Jun 18, 2015 by avibootz
0 votes
echo filesize("e:\\error_log.txt") . " bytes"; 


/*
run:

32604072 bytes
 
*/

 





answered Dec 2, 2015 by avibootz
0 votes
$fz = filesize("e:\\error_log.txt"); 

echo number_format($fz) . " bytes";


/*
run:

32,604,072 bytes
 
*/

 





answered Dec 2, 2015 by avibootz

Related questions

1 answer 93 views
1 answer 158 views
1 answer 53 views
2 answers 93 views
93 views asked Jan 23, 2021 by avibootz
1 answer 88 views
...