You have two options, one of which has already been mentioned in the comments by @Akintunde.
Pass it as an argument:
function fc($arr) {
print_r($arr);
}
fc($t);
If you intend to modify it, pass it by reference:
function fc(&$arr) {
$arr[0] = 'test';
}
fc($t);
echo $t[0];
You have already mentioned the global method, which is likely not working due to scope, see: http://php.net/manual/en/language.variables.scope.php. But I can not stress this enough, use of global and $GLOBALS should be avoided at all costs, it is a terrible programming practice and will cause you many headaches down the track.
Another method that keeps your variables out of the scope of the external application is to put everything into your own static class, this will prevent accidental variable reuse.
class MyClass
{
private static $t = [];
public static function set($index, $value)
{
self::$t[$index] = $value;
}
public static function get($index)
{
return self::$t[$index];
}
}
MyClass::set(0, 'test');
echo MyClass::get(0) . "\n";
And if you want to ensure your class doesn't clash with an existing class, namespace it: http://php.net/manual/en/language.namespaces.php