PHP Learning--Basic knowledge summary

Source: Internet
Author: User
One: PHP variables

    1. Seven major variable types

      Integer, Float, String, Array, object, NULL, resource.

    2. Scope of the variable
      Local, Global
      Built-in Super global variables:
      $GLOBALS 、所有全局变量的数组
      $_SERVER、服务器环境变量数组
      $_GET、通过GET方法传递给该脚本的变量数组
      $_POST、通过POST方法传递给该脚本的变量数组
      $_COOKIE、cookie变量数据
      $_FILES、与文件上传相关的变量数组
      $_ENV、环境变量数组
      $REQUEST、所有与用户输入的变量数组
      $SESSION、会话变量数组

    3. Variable detection function
      Is_xxx (), is a variable of type XXX

    4. State detection of variables
      Isset (): Whether the variable is set
      Unset (): Destroying variables
      Empty (): detects if a variable exists, and whether its value is null and not 0

    5. Constant definition
      define('常量名','常量值');

Two: operator

    1. Arithmetic operators
    2. String operator
    3. Assignment operator
    4. Comparison operators
    5. logical operators
    6. Bitwise operators
    7. Other operators
      Ternary operator, error suppressor @, type operator instanceof

Three: Logical Structure

1. Select structure
If, If~else, switch~case
2. Cyclic structure
While, for, foreach

Summary picture

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the PHP learning-basic knowledge summary, including the content, I hope that the PHP tutorial interested in a friend helpful.

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