Answers for "get size php"

PHP
1

php get string size

$str = "Hello Grepper!";
echo strlen($str); //echo 14
Posted by: Guest on July-12-2021
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
0

filesize in php

$file = '/path/to/your/file';
$filesize = filesize($file); // bytes
$filesize = round($filesize / 1024, 2); // kilobytes with two digits
 
echo "The size of your file is $filesize KB.";
Posted by: Guest on June-11-2020

Browse Popular Code Answers by Language