filesize 


php128 apg

GETS the size of a particular file.

Any information collected by this function will be available until it is destroyed by the clearstatcache function.





This function returns the file size in bytes or FALSE with an E_WARNING on error.

Because some systems has the limitation of 32 bit, these systems may return unexpected size for files larger than 2GB.



<?php

int
|false filesize str $filename )

where,

$filename The path to the file
                 
?>
 

 $filename 


The path to the file to check.



  1 EXERCISE   

<?php

define
("PN"__DIR__ '/temp/');

$path01 PN;

$flatm01 glob($path01 '*'GLOB_BRACE);

foreach(
$flatm01 as $k01 => $v01)
{

if(
is_file($v01))
{
echo 
'The file:<br>' basename($v01) . 
'<br>occupies:<br>' filesize($v01) . ' bytes.<br><br>';
}
elseif(
is_dir($v01))
{
echo 
'The directory:<br>' basename($v01) . 
'<br>occupies:<br>' filesize($v01) . ' bytes.<br><br>';        
}
else
{
echo 
'The file or directory:<br>' $v01 
'<br>does not exist.<br><br>';    
}
}

clearstatcache();

?>