Php basic statement variable symbol, php basic statement variable

Source: Internet
Author: User

Php basic statement variable symbol, php basic statement variable

Central topic
Mark and comment
//
/**/
Output statement
Echo output
Echo can output multiple strings separated by commas (,).
Print Output
Print can only output one string, returns true or false
Print_r ()
Strings and numbers can be simply printed out, while arrays are displayed in the form of an enclosed key and a list of values, starting with Array.
Var_dump ()
Output type
Data Type
Weak Language
Gettype ()
Judge type is _ type name ()
Variable definition
$ Variable name = Value
Super global variable $ GLOBALS
Variable
Isset ()
Variable definition?
Unset ()
Clear variable
Empty ()
Determines whether the variable is null.
& Get address
Type conversion
(Data Type) Variable
Type conversion settype (variable name, type)
Operator expression
Mathematical Operators
+
-
*
/
%
++
--
+ =
-=
String
Concatenate a string with vertices.
Comparison Operators
><>==! =
Logical operators
And &&
Or |
!
Others
@ (Error control operator)
Ternary Operators
? :
Judgment condition? :
Statement
Branch
If... else
Switch... case
Loop
For
While
Function
Definition
Four Elements
Use
Common
Random number generator rand ()
Current Time
Time ()
Date ()
Strtotime ()
Convert datetime to UNIX Timestamp
Set Time Zone
Date_default_timezone_set ('prc ')
Date. timezone = Europe/Paris changed to Etc/GMT-8
Format the date and time
Date ()

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.