How to get file size in php ?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Now here i will show to get file size in php. If we need to get the file size in php application then we can do it easily by using filesize() of PHP. Normally if we need to get and also check on before any image uploading or file uploading. So if we want to get the image size or file size then you need to follow the bellow example.

I hope it will help you. It will return us size on byte.

Example:

echo filesize('flower10.jpg') . ' bytes';

Read Also : How to convert Object into Array in PHP?

Thanks for read. I hope it help you. For more you can follow us on facebook.

About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →