PHP Basic Syntax

Source: Internet
Author: User

Start and end tags

<?php

?>

<script language= "PHP" >

</script>

Note Three ways to note: Multiple lines of comments cannot be nested within a multiline comment, but you can nest single-line comments or embed multiline comments in a single-line comment.

/* Multiline Comment */

Single-line Comment

# single Comment

Blank Handling

Variable

Variable declaration

1 <?PHP2 $a = 100; Assign $ A to an integer value of3 $b = "string"; Assignment $b to a string value of "string"4 $c = true; Assign a value of $c to a Boolean value of True5 $d = 99.99; The assignment $d is a floating-point decimal number 99.996     7 $key 1 = $a; Declares a variable $key1 assigns $a variable to it8 $key 2 = $b; Declares a variable $key2 assigns $b variable to it9 $a = $b = $c = $d = $e = $f = "value"; Declare multiple variables at the same time and assign the same valuesTen      One ?>
assigning values to variables

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.