ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

Local and Global Scope


<?php
$x=5; // global scope
 
function myTest() {
  $y=10; // local scope
  echo "<p>Test variables inside the function:</p>";
  echo "Variable x is: $x";
  echo "
";
  echo "Variable y is: $y";
}
 
myTest();
 
echo "<p>Test variables outside the function:</p>";
echo "Variable x is: $x";
echo "
";
echo "Variable y is: $y";
?>


'์›น ์ฝ”๋”ฉ > php' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

PHP The global Keyword (2)  (0) 2015.03.31
PHP The global Keyword (1)  (0) 2015.03.31
Creating (Declaring) PHP Variables  (0) 2015.03.31
PHP 5 Variables  (0) 2015.03.31
PHP Case Sensitivity (2)  (0) 2015.03.31
๋Œ“๊ธ€
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
ยซ   2025/02   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
๊ธ€ ๋ณด๊ด€ํ•จ