Not quite what i was after.. but it will do the trick. Thanks
to install on ubuntu i did
apt-get install vnstat
then i ran ifconfig and got the name of the interface that is in use.
then start vnstat replace eth0 with your interface name
sudo vnstat -u -i eth0
once its running make the dir you want to put the phpstats into replace webXX with your domain directory.
.. you can also login to the ftp to make the folder but make sure it is chmodded to 777 or vnstat cant write to it.
edit crontab and add the following replace XX with your domain folder and eth0 with your network adapter name.
0,30 * * * * vnstat --dumpdb -i eth0 > /var/www/webXX/web/server/vnstat_dump_eth0
upload the PHP stats into the same folder and edit config to read.
$vnstat_bin = '';
$data_dir = '/var/www/webXX/web/server';
you can now access the stats via www.yourdomain.com/server
stats are updated every at 0mins and 30mins of every hour so it may take a little while for the stats to update. you can force and update by running.
vnstat --dumpdb -i eth0 > /var/www/webXX/web/server/vnstat_dump_eth0