okay so I have a php file sitting on main root and I am trying to get the filesize of the files in a lower folder on my server.
Example: http://website.com/myphpfile.php trying to access: http://website.com/movies/[with everything in in]
I keep getting 0 or some random number but I can't get it to produce the size for each file.
 // Opens directory
$myDirectory = opendir("./movies"); 
// Gets each entry
while($entryName = readdir($myDirectory)) {
   $dirArray[] = $entryName;
}
I am using this snippet:
function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f %s')
{
    // Pick units
    $systems['si']['prefix'] = array('B', 'K', 'MB', 'GB', 'TB', 'PB');
    $systems['si']['size']   = 1000;
    $systems['bi']['prefix'] = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB');
    $systems['bi']['size']   = 1024;
    $sys = isset($systems[$system]) ? $systems[$system] : $systems['si'];
    // Max unit to display
    $depth = count($sys['prefix']) - 1;
    if ($max && false !== $d = array_search($max, $sys['prefix'])) {
        $depth = $d;
    }
    // Loop
    $i = 0;
    while ($size >= $sys['size'] && $i < $depth) {
        $size /= $sys['size'];
        $i++;
    }
    return sprintf($retstring, $size, $sys['prefix'][$i]);
}
My question is how do I call those files?
I know this is wrong here but what should it be?
$thefilesize = size_readable(filesize($entryName));
OR
Can someone write/edit this code to help me understand what is going on and where/what it's grabbing?