Answers for "php get file size"

PHP
2

php get size of file

$fileSizeInBytes=filesize("/path/to/myfile.txt");
Posted by: Guest on October-22-2019
0

filesize in php

$file = '/path/to/your/file';
$filesize = filesize($file); // bytes
$filesize = round($filesize / 1024 / 1024, 1); // megabytes with 1 digit
 
echo "The size of your file is $filesize MB.";
Posted by: Guest on June-11-2020
9

php get filetype

<?php
echo filetype('/etc/passwd');  // file
echo filetype('/etc/');        // dir
?>
Posted by: Guest on February-03-2021
0

filesize in php

$file = '/path/to/your/file';
$filesize = filesize($file);
 
echo "The size of your file is $filesize bytes.";
Posted by: Guest on June-11-2020
0

get file size in php

$img = get_headers("file URL", 1);
echo $img["Content-Length"];
Posted by: Guest on May-13-2021

Browse Popular Code Answers by Language