Home > Backend Development > PHP Tutorial > 2016-04-06 When is the Spring Festival in 2016? Year of the Monkey 2016? Tomb-Sweeping Day Holiday Schedule 2016

2016-04-06 When is the Spring Festival in 2016? Year of the Monkey 2016? Tomb-Sweeping Day Holiday Schedule 2016

WBOY
Release: 2016-07-29 08:54:46
Original
1052 people have browsed it

data-id="1190000004881701">

PHP tag

  • Form one

    <code><?php  ?>
    </code>
    Copy after login
  • Form two

    <code><script language="php"></script>
    </code>
    Copy after login
  • Form three

This form needs to rely on a configuration in php.ini short_open_tag = On

<code><? ?>
</code>
Copy after login

If there is no html behind php, can it be omitted?>

PHP case-sensitive feature

  • Variable differentiation

  • Constant differentiation

  • Others are not differentiated

About points The number

  • should be added to every sentence;

  • The last sentence in a php tag does not need to be added;

  • If the end tag is omitted, the last sentence cannot be omitted;

About comments

  • Single-line comments // or #

  • multi-line comments /% %/

Variables

  • There is no simple definition

  • isset to determine whether the variable exists

<code>$v1 = isset($s1);  // false
$s2 = 1;
$v2 = isset($s2); //true</code>
Copy after login
  • unset deletes variables

<code>$v1 = 1;
isset($v1); //true
unset($v1);
isset($v1); // false</code>
Copy after login

The variable names that can be used

  • start with letters or underscores

  • followed by any number (including 0) of letters, numbers and underscores

Naming rules

  • Camel nomenclature: the first word is lowercase, and the first letter of each subsequent word is capitalized

<code>$name   $myName   $myFatherName</code>
Copy after login
  • Pascal nomenclature: the first letter of each word is capitalized

<code>$Name   $MyName   $MyFatherName</code>
Copy after login
  • underscore separation method: each Words are lowercase and separated by underscores

<code>$name   $my_name   $my_father_name</code>
Copy after login

Variable value transfer method

Value transfer

The values ​​​​of two variables do not affect each other

Reference transfer

Values ​​affect each other

<code>$m1 = 1;
$m2 = & $m1</code>
Copy after login

The above introduces 2016-04-06, including the content of 2016. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template