You may as well just turn on the No-Cache header option in vBulletin Options. If you do insist on using your method, you need to return the value and not print it.
PHP Code:
function autoVer($url)
{
$path = pathinfo($url);
$ver = '.' . filemtime('/home/yadayada/public_html/' . $url) . '.';
return $path['dirname'] . '/' . str_replace('.', $ver, $path['basename']);
}
$bannercss = autoVer('/css/banner.css');