Making Variables Global in PHP?

I think they're already global PHP does not have a block-level scope.

I think they're already global. "PHP does not have a block-level scope.

They can't be surely because it isn't printing the details. – ritch Jan 22 at 19:42 However, If I put it in the same scope then it works. – ritch Jan 22 at 19:42 @ritch What do you mean by 'the same scope'?

Where did you move it to get it to work? – sdleihssirhc Jan 22 at 19:44 below the include of the lib/sidebar. Php – ritch Jan 22 at 19:48 @ritch Maybe sidebar.

Php is introducing other global variables that are messing with the current page. For example, maybe it has a variable named $row that is overwriting your current $row. – sdleihssirhc Jan 22 at 19:50.

You could store them in session variables, similarly to your $_SESSION'LoggedIn'.

You could also use php variable $GLOBALS for making your variables visible in all scopes but I would not recommend it for this kind of task. Also, beware - $GLOBALS contains superglobals like $_POST and $_GET, you should keep that in mind, when ie. Iterating over it.

Furthermore - when you can access $_GET and $_POST in functions, that have smaller scope you still have to use $GLOBALS to access custom ones. Example for this kind behaviour.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions