codehaven - php snippets - coding help
Generic filters
Exact matches only
  • Give a function access to outside variable

    8th September 2016

    Php - Miscellaneous

    php codehaven

    By default, when you are inside a function, you do not have access to the outer variables.

    If you want your function to have access to an outer variable, you have to declare it as global, inside the function

    Was this code snippet helpful?