Php entry-level self-study demonstration, php entry-level self-study demonstration
<! Doctype html>
<Html>
<Head>
<Title> PHP function demo </title>
</Head>
<Body>
<? Php
// Function Definition
Function name (){
Echo "this is a no-argument function ";
}
Name (); // No parameter function call
Function name ($ age, $ height ){
Print "This is a function with parameters <br/> ";
Echo "height". $ height. ", age:". $ age. "CM ";
}
Name (20,170 );
/*
The following are some of the knowledge points recorded by new students.
There are two main output statements in PHP;
1: print, output a single variable or string;
2: echo: outputs multiple variables or strings, and the execution efficiency is much faster than print.
3: php is a weak language;
4: the loop, judgment, and Branch selection statements in php are similar to those in C # And js;
5: The array naming method is somewhat unique:
$ Arr = array (key => value, key => value ,...);
Example: $ man = array ("age" => 20, "height" => 172, "weight" => 60 );
Indexes do not necessarily start from [0], but are defined as "age", "height", and "weight ";
To obtain elements in an array, you can only use $ man ["age"], $ man ["height"], and $ man ["height;
*/
?>
</Body>
</Html>