[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Beginner PHP Tutorial – 33 – Global Variables and Functions
by
Tags:
Comments
25 responses to “Beginner PHP Tutorial – 33 – Global Variables and Functions”
-
Why do we not pass the $user_ip variable as an argument to the function?
-
Why does my
echo $user_ip = $_SERVER['REMOTE_ADDER'];REMOTE_ADDER act as a string??? It does not return me my ip
-
perfect! thanks
-
If you're getting "::1", don't worry, you just have to download more memory.
-
So…"global" just tells the function it needs to find a function outside of it? Gotcha
-
<?php
echo $user_ip = $_SERVER["REMOTE_ADDR"];
?>This is all that shows up on my screen "::1". Using xampp with windows 10, chrome and firefox.
-
hey .. i am not able to see my ip .. what may be wrong ??? i have written the code correctly
-
Good Tutorials man it is a very nice initiative that you are serving to people
-
cool!!!
-
wouldn't it be easier to say public … blah blah instead of stating its global?
-
Ok I get it, but will it make it global in all other functions i have written too?
-
Thank You!
-
Can I use the global keyword outside the function, just before the variable declaration?
-
can i know the reason why am getting a ' ::1 '…??
-
Important details are never missed in Alex's tutorials. Very professional! You'll soon be very thankful for his long-sightedness!
-
Find your h t tp d . conf file for apache and look for Listen 80. When you find it change it to Listen 127.0.0.1:80. Save the file and then restart your server. Worked for me. It may be different for you.
-
When I outputted the user_up the result was this, :::1
-
English could be good too, if you used it properly ^^
-
Just glad when ppl who take the time to do these tuts don't respond to the stupid youtube trolls. Good Job Man! Thanks.
-
YOU SHOULD TALK FAG!!
-
im getting the same issue. how did you solve yours?
-
Thanks Wrolfgaming..i see your answer and i resolve this issue..
-
hey guys….how to resolve it ? i.e.
Fatal error: Function name must be a string in C:xampphtdocstutorialgloval.php on line 3 -
Can u make it global outside the function and then use it inside?
-
the silence was insane when he forget to call the function… 😀
Leave a Reply