PHP/File Directory/filesize — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
| |
Версия 10:37, 26 мая 2010
Determining File Size with filesize()
<?
print "The size of test.txt is. ";
print filesize( "test.txt" );
?>
filesize() function returns the size, in bytes.
Its syntax is: int filesize (string filename)
<?
$fs = filesize("data.txt");
print "Pastry.txt is $fs bytes.";
?>
filesize.php
<?php
$file = "data.txt";
$bytes = filesize("$file");
echo "File ".basename($file)." is $bytes bytes, or ".round($bytes / 1024, 2)." kilobytes.";
?>