In PHP, variables declared inside a function can be accessed outside of that function.

  • TRUE
  • FALSE
Variables declared inside a function in PHP have a local scope. This means they are only accessible within that specific function. Once the function execution ends, the local variables are destroyed and cannot be accessed from outside the function. In order to access variables across different scopes, you would need to use return statements or pass them as parameters. Learn more: https://www.php.net/manual/en/language.variables.scope.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *