PHP Initial Knowledge _php Tutorial

Source: Internet
Author: User
Php:hypertext Preprocessor (Hyper-text preprocessing language), server-side script.

1. Start and end tags, there are 2 kinds of common PHP Tags:

And


2. Note: Similar to the general language

3. Data type:

Four scalar types: Boolean,integer,float (also called double), string

Boolean: 0 or NULL is False, others are true

String: A character is a byte, there are four ways to define it.


Two composite types: Array,object

Array: Key value collection, only integer and string as key

Object

Two special types: Resource,null

Resource: A resource is a reference to an external resource.

Variable definitions do not support explicit type definitions, and are determined by the context in which PHP is used by the variable at run time.


4. Variables

USD matches + variable name, case sensitive

Variable variable, feel the root of the two-dimensional array almost, did not look carefully.

Magic constant, it sounds special.


5. Control structure

If-else: Like a high-level language, but there are alternative grammars, no mastery, but should read the code

While,for: Cycle

Break ends the execution of the current for,foreach,while,do-while or switch structure. Break can accept an optional numeric parameter to decide to jump out of a few loops.


http://www.bkjia.com/PHPjc/477200.html www.bkjia.com true http://www.bkjia.com/PHPjc/477200.html techarticle Php:hypertext Preprocessor (Hyper-text preprocessing language), server-side script. 1. Start and end tags, there are 2 kinds of generic PHP tags: php? and script Language=php/script 2. Comments: ...

  • 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.