Beginner PHP Tutorial – 33 – Global Variables and Functions

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

25 responses to “Beginner PHP Tutorial – 33 – Global Variables and Functions”

  1. linus lexy Avatar

    Why do we not pass the $user_ip variable as an argument to the function?

  2. Liam Avatar

    Why does my
    echo $user_ip = $_SERVER['REMOTE_ADDER'];

    REMOTE_ADDER act as a string??? It does not return me my ip

  3. Pedro MR Avatar

    If you're getting "::1", don't worry, you just have to download more memory.

  4. wessltov Avatar

    So…"global" just tells the function it needs to find a function outside of it? Gotcha

  5. Pirate Junkies Avatar

    <?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.

  6. Abhishek kumar Avatar

    hey .. i am not able to see my ip .. what may be wrong ??? i have written the code correctly

  7. Gautam Sharma Avatar

    Good Tutorials man it is a very nice initiative that you are serving to people

  8. Joe Pearson Avatar

    wouldn't it be easier to say public … blah blah instead of stating its global?

  9. TheMatDark Avatar

    Ok I get it, but will it make it global in all other functions i have written too?

  10. UnWorld Avatar

    Can I use the global keyword outside the function, just before the variable declaration?

  11. Sairam Sikhakolli Avatar

    can i know the reason why am getting a ' ::1 '…??

  12. Paweł Wysocki Avatar

    Important details are never missed in Alex's tutorials. Very professional! You'll soon be very thankful for his long-sightedness!

  13. John Avatar

    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.

  14. Cj Vaans Avatar

    When I outputted the user_up the result was this, :::1

  15. Marcos Pereira Avatar

    English could be good too, if you used it properly ^^

  16. J Carson Avatar

    Just glad when ppl who take the time to do these tuts don't respond to the stupid youtube trolls. Good Job Man! Thanks.

  17. Mike Smith Avatar

    YOU SHOULD TALK FAG!!

  18. cardwell164 Avatar

    im getting the same issue. how did you solve yours?

  19. rahulit91 Avatar

    Thanks Wrolfgaming..i see your answer and i resolve this issue..

  20. rahulit91 Avatar

    hey guys….how to resolve it ? i.e.
    Fatal error: Function name must be a string in C:xampphtdocstutorialgloval.php on line 3

  21. TheYaqubian Avatar

    Can u make it global outside the function and then use it inside?

  22. zeeshan jamal Avatar

    the silence was insane when he forget to call the function… 😀

Leave a Reply to wessltov Cancel reply

Your email address will not be published. Required fields are marked *