You can use PHP function filesize() to get the size of the file in bytes. This function requires a filename as an argument and returns file size in bytes on success, FALSE on failure.
Here is an example to check the size and delete a file using PHP.
<?php
$filename = "phpinfo.php";
if (filesize($filename) < 100000){
if (unlink($filename)){
print("File was deleted successfully\n");
}else{
print("Something went wrong\n");
}
}else{
print("File is bigger than 100k\n");
}
?>