50th Day class PHP basic syntax

Source: Internet
Author: User

(01) PHP tagged <?php?>

<? ?>

<%%>

<script lauguage= "PHP" ></scrit>

(02) Output statement echo "", "", ""//Can output multiple

Print ""//Output only one

(03) Comments///* *

(04) data type int double float string char datetime (TIME) bool

(05) Define the variable $x = ""; Variable must start with $

(06) variable variable $a = "B";

$b = "word";

echo $ $a; The output is Word

(07) Determine if the variable has a value isset ()//null or 0 is false

(08) Clear variable unset ()

(09) Determine if the variable is empty ()

(10) Take the address character &

$a = 5;

$b =& $a;

$b = 10;

echo $a; Output is 10

(11) Output variable information details dump ()

Type name GetType ()

(12) Type conversion cast setType (variable, type)//cast variable to desired type

Type +var ()

(type) + variables such as (int) $a; Turn A into an integral type

Auto-conversion (rule) priority from high to low is floating point > Integer > Boolean, String

Boolean and string are converted to numeric types when the operation

string conversion to a number type only extracts the beginning of the number, E is 10 as the bottom of the multi-square

(13) stitching strings.         such as echo "". $a. ""; The middle of the output is a sentence of variable a

(14) Error suppressor @//Mask off error

(15) Conditional operator? : Structure: Judging condition? Output when correct: error when output

(16) escape character \ n line break \ r enter \ t Horizontal tabulation

(17) The variable echo "hello{$a}hi" can be parsed in double quotes

(18) Delimiter definition character channeling $a =<<

50th Day class PHP basic syntax

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.