function auto_version($file) {
if(!file_exists($file))
return $file;
$mtime = filemtime($file);
return $file."?v=" . $mtime;
}
Now modify your include links as given below:
<script type="text/javascript" src="<?php echo auto_version("js/custom.js") ?>"></script>
Now you never have to update the include link to force the file reload, it will automatically check the file modification timestamp and append that to URL.