Activity 4 - Feb 9, 2026

Submitted by Calina Winfield



Variable Scope

The value of my global variable x is 10
Access the global variable x inside a function
This will generate a warning message.
Access the global variable x after we specified it's global, and the value is 10
The value of the local variable y inside myFunction() is 20
Access the the local variable y outside of myFunction(), the value is
This will generate a warning message.

Using Loop to Build Tables

Table 1

You can access the global variable defined in another section of the PHP code.The value for variable x is 10
01234567
01234567
01234567
01234567
01234567
01234567
01234567
01234567

Table 2

01234567
01234567
01234567
01234567
01234567
01234567
01234567
01234567

Table 3

          
          
          
          
          
          
          
          
          
          

Table 4: four colors RGBY

               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

Table 5: any number of colors