What is global? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

What is global?

25th Dec 2015, 8:58 AM
Faraz Ahmed
Faraz Ahmed - avatar
36 Answers
+ 32
Global declaration of a variable means the variable can be declared at once and can be used throughout the program anywhere . The global declaration is done at the start of the program after header files and before the start of main function or any other function.
13th Jun 2016, 6:10 AM
Satan 666
Satan 666 - avatar
+ 6
it is a variable to mention a outside of the content program local is with in the content program
30th Nov 2016, 12:31 PM
G.Gokulnath
G.Gokulnath - avatar
+ 6
Write once, access from anywhere.
9th Dec 2016, 7:47 PM
Umesh Chandra Chaurasia
+ 4
a global variable is a variable that is visible in all functions
8th Dec 2016, 11:42 PM
Adrian Gorea
Adrian Gorea - avatar
+ 3
As I know n according to the tutorial, u can use it inside the function to enable access to the variable value declared outside ur function
26th Dec 2015, 4:08 PM
Stenly Binambuni
Stenly Binambuni - avatar
+ 3
Accessible in all functions
1st Dec 2016, 9:45 AM
Gilson Gilbert
Gilson Gilbert - avatar
+ 3
Global is the outermost environment. It is outside of all functions. For a browser, Global is your browser window. Just the window, not the browser.
7th Dec 2016, 3:45 PM
Ken Jones
Ken Jones - avatar
+ 3
In PHP, global variables are referred to the variable that are available in any page that contains PHP script in your website. Examples are - $_GET, $_SESSONS, $_COOKIE and $_GLOBAL
24th Dec 2016, 5:18 AM
Raniket Ram
Raniket Ram - avatar
+ 2
accessible by all class/variable in your program....
6th Dec 2016, 1:46 AM
Dhiraj singh✔️
Dhiraj singh✔️ - avatar
+ 1
🖐
5th Dec 2016, 10:27 PM
hadi
+ 1
I am awesome no exception!!!!
9th Dec 2016, 8:52 PM
hfjcbid
+ 1
it's variables you can call it from any where in programme
10th Dec 2016, 9:12 AM
Sajad Lateef
Sajad Lateef - avatar
+ 1
declare in all functions
10th Dec 2016, 11:04 AM
meena nemo
meena nemo - avatar
+ 1
global is a php keyword used for accessing variable which is out side the function
10th Dec 2016, 2:21 PM
Aftab Ansari
Aftab Ansari - avatar
+ 1
declared once in program use at any place depending on need
28th Dec 2016, 2:40 PM
Dhiraj singh✔️
Dhiraj singh✔️ - avatar
+ 1
warming
24th Jan 2017, 2:34 AM
Ömer An
Ömer An - avatar
0
global variable - means can be used anywhere in your code. There are also local - can be used inside function, class variable - inside your class, and instance variable - variable that is used within object.
30th Nov 2016, 7:34 AM
Alex89
Alex89 - avatar
0
global variable are those variable which are declared in the header section . It can be used anywhere in the any part of the program .
30th Nov 2016, 11:26 AM
Yashwin Munsadwala
Yashwin Munsadwala - avatar
0
A scope is a region of the program and broadly speaking there are three places, where variables can be declared − Inside a function or a block which is called local variables, In the definition of function parameters which is called formal parameters. Outside of all functions which is calledglobal variables.
30th Nov 2016, 7:34 PM
Sonu Baghel
Sonu Baghel - avatar
0
declarations that are done globally (variable or function) can be used anywhere in the program..
2nd Dec 2016, 1:50 PM
Rahul Sharma
Rahul Sharma - avatar