Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
What Is the Scope of a Variable Defined in a Function
What Is the Scope of a Variable Defined in a Function? - PHP Script Tips - Creating Your Own Functions
✍: FYIcenter.com
The scope of a local variable defined in a function is limited with that function. Once the function is ended, its local variables are also removed. So you can not access any local variable outside its defining function. Here is a PHP script on the scope of local variables in a function:
<?php ?> function myPassword() { $password = "U8FIE8W0"; print("Defined inside the function? ". isset($password)."\n"); } myPassword(); print("Defined outside the function? ". isset($password)."\n"); ?>
This script will print:
Defined inside the function? 1 Defined outside the function?
2007-04-24, 4596👍, 0💬
Popular Posts:
How To Select All Columns of All Rows from a Table? - MySQL FAQs - SQL SELECT Query Statements with ...
Where Do You Download JUnit? Where do I download JUnit? I don't think anyone will ask this question ...
How To Export Data to an XML File? - Oracle DBA FAQ - Introduction to Oracle SQL Developer If you wa...
How to make elements invisible? Change the "visibility" attribute of the style object associated wit...
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...