In terms of structure, there are strict differences between uppercase letters of C, C ++, JAVA, and Perl and lowercase letters. For example, $ I and $ I are two different variables. Basic items
In terms of structure, there are strict differences between uppercase letters of C, C ++, JAVA, and Perl and lowercase letters.
For example, $ I and $ I are two different variables.
Therefore, properly describe the upper and lower case letters of the function.
The delimiters and Perl are somewhat different in structure.
<And <are required.
Print <END_OF_HTML does not end 「;」.
Do not end with ";" at the end of END_OF_HTML 「;」.
print <<< END_OF_HTMLabcde
fghijkl
END_OF_HTML;
It is possible to place the number of delimiters into the variable.
$msg = <<< END_OF_HTMLabcde
fghijkl
END_OF_HTML;
Parameters are the same as those in C.
The address can also be transferred.
User functions
Function UserFunction ($ para1, $ para2,...) {global $ a; static $ B; $ c = 1; encoding... return returncode ;}
** Return values can be sent in return.
** The address sent to the parameter is UserFunction (& $ para1 ).
** Function UserFunction (& $ para1, & $ para2 ,...) The specified address can also be sent to functions.
Sample code verification
Variable \ $ a = $\ N "; print"Variable \ $ B = $ B
\ N "; print"Variable \ $ c = $ c
\ N "; print"Variable \ $ d = $ d
\ N "; print"Variable \ $ e = $ e
\ N "; /* ===================================================== ======================================== test function ========================================================== ====================== */function test ($ p) {global $ a; static $ B; $ c = 1; $ a + = 10; $ B + = 20; $ c + = 30; $ p + = 40; return (50) ;}?>
[Execution result]
Variable $ a = 110
Variable $ B = 200
Variable $ c = 300
Variable $ d = 400
Variable $ e = 50
** $ A, use the function test (), global $ a;, and declare it as 110.
** $ B, $ c, $ d, and functions become other things in test () without being affected.
The local variables and scope of common concepts of global functions are the same as those of VB.
You can refer to "VB basics (part 5) function construction (sub, function )』.