Re: GLOBAL in function ...()

From: Date: Thu, 20 Jul 2000 18:44:37 +0000
Subject: Re: GLOBAL in function ...()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-7452@lists.php.net to get a copy of this message
In article <20000720190319.E5158@digiro.net>, teo@digiro.net (Teodor Cimpoesu) wrote: Do you know how extract() handles multidimensional hashes? Jeff > Hi Noor! On Thu, 20 Jul 2000, Noor Dawod wrote: > >> function AnotherCheck( ) { >> global {all global variables}; > try: extract ($GLOBALS); > >> >> if( $a + $b == $c + $d ) { >> echo "True"; >> } else { >> echo "False"; >> } >> } >> >> Check( ); AnotherCheck( ); >> >> ?> >> >> Both should produce same results, even though the second function >> didn't explicitly specify each variable's name in "global" definition. >> > also you can use $GLOBALS['a'], $GLOBALS['b'], so on. > > -- teodor >

« previous php.general (#7452) next »