<?php $file = "data.txt"; $bytes = filesize("$file"); echo "File ".basename($file)." is $bytes bytes, or ".round($bytes / 1024, 2)." kilobytes."; ?>