PHP 8.5.0 Alpha 1 available for testing

Voting

: three plus six?
(Example: nine)

The Note You're Voting On

synnus at gmail dot com
9 years ago
// extract filesize with command dir windows 10
// is ok for all system 32/64 and the best compatibility for Dummy file
// but cant return value in (int) for best return use Float

<?php

filesize_dir
("d:\\test.mkv"); //11.5GB => return (float) 12401880207

function filesize_dir($file) {
exec('dir ' . $file, $inf);
$size_raw = $inf[6];
$size_exp = explode(" ",$size_raw);
$size_ext = $size_exp[19];
$size_int = (float) str_replace(chr(255), '', $size_ext);
return
$size_int;
}

?>

<< Back to user notes page

To Top