php4-beta | 200004
Date: 04/22/00
- Next message: thies <email protected>: "[PHP4BETA] Re: Oracle and Win32"
- Previous message: chagenbu <email protected>: "[PHP4BETA] imap_utf7_decode doesn't work"
- In reply to: Bob Silva: "[PHP4BETA] Behavior of $GLOBALS array changed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
That's an easy one, you forgot to identify $str as a global inside the
function, as in:
function Test()
{
global $str;
echo $GLOBALS[$str];
}
or you could have nested some $GLOBALS[]
Shawn
At 10:59 AM 4/21/2000 -0700, you wrote:
>As I'm sure you know, in PHP3 this would work, however in PHP 4 it does not.
>I'm sure its for a reason, I just need to know the proper way:
>
><?
>
>$newrequests = "newrequests";
>
>$str = "newrequests";
>
>echo $GLOBALS[$str]; #<-- Prints it
>
>function Test() {
> echo $GLOBALS[$str]; #<-- Does not
>}
>
>Test();
>
>?>
>
>
>Thanks, Bob aka Salty```
>
>
>--
>PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
>To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
>For additional commands, e-mail: php4beta-help <email protected>
>To contact the list administrators, e-mail: php4beta-admin <email protected>
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: thies <email protected>: "[PHP4BETA] Re: Oracle and Win32"
- Previous message: chagenbu <email protected>: "[PHP4BETA] imap_utf7_decode doesn't work"
- In reply to: Bob Silva: "[PHP4BETA] Behavior of $GLOBALS array changed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

