Tabela de conteúdos

variavel global

http://stackoverflow.com/questions/9045445/auto-prepened-php-file-using-htaccess-relative-to-htaccess-file

php.ini
register_globals = On
.htaccess
php_value auto_prepend_file "./globals.php"

criando a biblioteca

http://stackoverflow.com/questions/16706098/enable-register-globals-in-php-5-4

globals.php
foreach ($_REQUEST as $key=>$val) {
    ${$key}=$val;
}

teste variavel global

http://php.net/manual/pt_BR/language.variables.scope.php

teste.php
<?php
$a = 1;
$b = 2;
 
function Soma()
{
    global $a, $b;
 
    $b = $a + $b;
}
 
Soma();
echo $b;
?>