实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化
AخA
 
1
     <?php
2
    $x=5; // 全局变量
3
    function myTest()
4
    {
5
    $y=10; // 局部变量
6
    echo "<p>Test variables inside the function:<p>";
7
    echo "Variable x is: ";
8
    echo "<br>";
9
    echo "Variable y is: $y";
10
    } 
11
    myTest();
12
    echo "<p>Test variables outside the function:<p>";
13
     echo "Variable x is: $x";
14
    echo "<br>";
15
    echo "Variable y is: ";
16
    ?>