<?php $myfile = "./test.txt"; if (file_exists ($myfile)) { $checksize=filesize ($myfile); echo "$checksize"; } else { echo "The file doesn't exist!"; }?>