I have been doing quite a bit of PHP but I never tried this and would like to know if this is possible.

Is there any way I can define the scope of the variable in PHP?

Lets say I have an if statement and I want the variable to leave only in the if statement and the value should not be outside of the if statement. Is this possible in PHP.