PHP Local Variables - phptpoint

PHP Local Variables

PHP Summer Training/Internship with 2 Live Projects in Noida Fee is only 5500/-Click here to Book Your Seat.


Local Variable

=> Local variables are always initialize inside the funtciob body.

=> Local variable cant work outside function body.

Sum of given no = 300
Subtraction of given no = 300

Here define a variable $x and $y . Variable $x and $y has been defined inside add( ) function so these variables are not accessible outside the add( ) function.
Now if you want to access local variable $x and $y inside the sub( ) function then declare it first then use.

Latest Trending Technologies