Created
September 11, 2018 16:56
-
-
Save corocoto/a861810a1c33ab08f61827f5e92b292d to your computer and use it in GitHub Desktop.
localglobal.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$g = "global variable"; | |
$text = "some text"; | |
function output() | |
{ | |
//гворим функции, что мы будем использовать глобальную переменную $g | |
global $g; | |
echo $g."<br />"; | |
} | |
output();//выведет глобальную перменную, содержащую "global variable" | |
function outputText() | |
{ | |
$text="text";//локальная переменная $text | |
echo $text; | |
} | |
outputText();//выведет локальбную перменную, содержащую "text" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment