by
30 7
0
6
1,167
0
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 32854th place
Languagehandlebars
LicenseMIT_X11

Размер файла

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1485856/------------?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<?php // Enter here the actual content of the snippet. function getFilesize($file,$digits = 2) { if (is_file($file)) { $filePath = $file; if (!realpath($filePath)) { $filePath = $_SERVER["DOCUMENT_ROOT"].$filePath; } $fileSize = filesize($filePath); $sizes = array("TB","GB","MB","KB","B"); $total = count($sizes); while ($total-- && $fileSize > 1024) { $fileSize /= 1024; } return round($fileSize, $digits)." ".$sizes[$total]; } return false; } echo getFilesize("file_name.ext"); ?>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus