This function also can be great for browser caching controll. For example, you have a stylesheet and you want to make sure everyone has the most recent version. You could rename it every time you edit it, but that would be a waste of time. Instead, you can do like:
<?php
echo '<link rel="stylesheet" href="style.css?ver=1.'.filesize(dirname(__FILE__).'/style.css').'.'.filemtime(dirname(__FILE__).'/style.css').'.0">';
?>
Sample output:
<link rel="stylesheet" href="style.css?ver=1.8824.1499869132.0">
This also can be apply for JS and also images with same name.