PHP function Small Display
function definition
Function name () {
echo "This is a non-parametric function";
}
Name ();//no parameter function call
Function name ($age, $height) {
Print "This is an argument function
”;
echo "height". $height. ", Age:". $age. " CM ";
}
Name (20,170);
/*
The following is the new self-study of some of the knowledge points recorded, the great God do not like to spray oh.
There are two main kinds of output statements in PHP;
1:print, output a single variable or string;
2:echo, the output of multiple variables or strings, and execution efficiency is much faster than print.
3:php is a weakly typed language;
In the 4:php, the loops, the judgment, the Select branch statements are similar to the statements in the C#,JS;
5: The array naming method is a bit unique:
$arr =array (Key=>value,key=>value,...);
Example: $man =array ("Age" =>20, "height" =>172, "weight" =>60);
The index is not necessarily starting from [0], but our own definition of "age", "height", "weight";
To get the elements in the array, you can only pass the way of $man["age", $man ["height"], $man ["height"];
*/
?>
The above describes the introduction of PHP self-study small display, including the content of the article, I hope that the PHP tutorial interested in a friend helpful.