[TYPO3] global php variable

Arv Belialson arv.belialson at gmail.com
Wed Feb 28 23:36:57 CET 2007


2007/2/28, a owen <aowen at swissonline.ch>:
>
> Hi,
>
> I having troubles with "global" in my own php-functions. somehow my
> functions cant see outside variables even if i set them as global.
>
> $i = 5;
>
> function test() {
>         global $i;
>         echo $i;
> }
>
> There is no output, what can i do. i've checked google and php.net, but
> found nothing. i've tried it without typo3 an then it works so i dont
> think it's my server.
>
> i'm using:
> apache 2.0.55
> php 4.4.2-1.1
> typo3 4.0.2
> lumophpinclude 1.1.1
>
> please help, i'm demoralized by such a apparently easy function.
>
>
> you have to declare the variable as global before you use it in function


More information about the TYPO3-english mailing list