PHPphp.ini short_open_tag = On phphtml ?>PHP ;phptag;; // # /% %/isset $v1 = isset($s1); // false $s2 = 1; $v2 = isset($s2)"/> PHPphp.ini short_open_tag = On phphtml ?>PHP ;phptag;; // # /% %/isset $v1 = isset($s1); // false $s2 = 1; $v2 = isset($s2)">

Home  >  Article  >  Backend Development  >  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
WBOYOriginal
2016-07-29 08:54:461021browse

data-id="1190000004881701">

PHP tag

  • Form one

    <code><?php  ?>
    </code>
  • Form two

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

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

<code><? ?>
</code>

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>
  • unset deletes variables

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

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>
  • Pascal nomenclature: the first letter of each word is capitalized

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

<code>$name   $my_name   $my_father_name</code>

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>

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.

Statement:
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