Php entry-level self-study demonstration, php entry-level self-study demonstration

Source: Internet
Author: User

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>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.