1. Define constants:
Copy Code code as follows:
<?php
1
Define ("Tax_rate", 0.08);
Echo tax_rate; Output 0.08
2 (PHP 5.3)
Const TAX_RATE2 = 0.01;
Echo '--'. Tax_rate2; Output 0.01
?>
2, Require and require_once difference:
The former encounters the inclusion file, which determines whether it has already been included, and if it is included, no longer contains the file. One can save resources and two can avoid repeated definitions of errors.
3, include and include_once the difference:
Functions and functions can be a page, included to another page, the former can contain many times, the latter contains only once.
4, include and require distinction (meanwhile include_once and require_once)
Same: All can be introduced to other pages
Different: Include if an error occurs, the execution continues, and require an error occurs, the program is terminated.
Conclusion: When doing the project, we basically use require_once and write it in front of PHP.
5, the definition of variables in PHP is case-sensitive, defining the function when the case is not case-sensitive
Copy Code code as follows:
<?php
/* Define variable case sensitivity *
$ABC = 100;
$ABC = 200;
echo $abc. ' | '. $ABC; Output 100|200
/* Definition function is not case-sensitive the following writing system will error: Fatal error:cannot redeclare ABC () * *
Function abc () {
Echo ' abc ';
}
function ABC () {
echo "ABC";
}
?>