Hopefully a pretty simple question

(quite a newbie to PHP)
I want to be able to read the ubb config files e.g vars_config.cgi, vars_wordlets.cgi etc in PHP so I can use the UBB config in a PHP Script.
So for example I want to take..
[/code]To something like...
[code]
with a PHP function.
i.e so I can look at $vars_config[CGIURL] etc
Is there a function to be able to do this?
Shouldn't be too hard to make one, but my brain isn't thinking straight.