FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » A Few Noob Questions
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: A Few Noob Questions [message #175154 is a reply to message #175148] Wed, 17 August 2011 00:31 Go to previous messageGo to previous message
eBob.com is currently offline  eBob.com
Messages: 11
Registered: August 2011
Karma:
Junior Member
Thank you very much Denis. But now I have to ask ... How global are the
$GLOBALS? From you answer I assume that $GLOBALS have a scope which exceeds
one file. But how far beyond one file?

Are there any kind of read/write variables which are shared between users?

Thanks, Bob


"Denis McMahon" <denis(dot)m(dot)f(dot)mcmahon(at)gmail(dot)com> wrote in message
news:4e4ae161$0$27229$a8266bb1(at)newsreader(dot)readnews(dot)com...
> On Tue, 16 Aug 2011 11:02:40 -0400, eBob.com wrote:
>
>> How can the "units" of PHP between tags communicate? Can my PHP code
>> create $GLOBALS variables? How about $_SESSION variables?
>
> PHP processes a file. Within a file, you may have bunches of php code
> between "<?php" and "?>" tags, and may also have text output. The php
> code may include other files in various ways.
>
> All the code in the file, including in any included files, that is not
> part of a separate function definition operates in the same variable
> context.
>
> So, assuming between these cutlines is a single file:
>
> ------------8<------------
> <?php
> $a = 6;
> ?>
> output this text
> <?php
> echo $a . "\n"; // uses the previously defined value for $a
> ?>
> ------------8<------------
>
> If I save that as "basic.php" and then execute it in the cli:
>
> ~$ php basic.php
> output this text
> 6
>
> ~$
>
> Rgds
>
> Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to integrate paypal payment Indian currency support ..?
Next Topic: Looking for good C and C++ PHP plugin examples
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 23:53:18 GMT 2024

Total time taken to generate the page: 0.04070 seconds