PHP variable Scope| Global scope| Local scope| Static scope

preview_player
Показать описание
Hello, today we are introducing new topic i.e.PHP variable Scope

There are 3 types of variable Scope, they are as follows
1) Global scope
2) Local scope
3). Static scope

Global scope means variable declare outside the function and also used outside function if you want to used it in inside function then use "Global" keyword.

Local scope means variable is by default local when it declare within function means that
variable declare and used only within function not outside the function.

Static scope means when variable declare inside the function but there recent value should be preserve for future use then static keyword is before variable.
Рекомендации по теме
welcome to shbcf.ru