Global variables can be called upon any where in the script.local variables are not valid outside the code blocks they are created in.
Global variable is accessible any where is the sciript, but local have only be valid in the block,<br>so we can use the local variable to avoid the out side interference.