SQL statement: Select Code as ' code name ' from users;
Print_r () in PHP is a printed array. Var_dump () Output Variable type
PHP in double quotes inside can parse variables, single quotes can not parse escape character
$x = 1; + + $x; $y = $x + +; Executive $y
PHP substr () can intercept the string strlen () to take the length of the string str_replace () find replace the explode () function to break the string into arrays.
Exit () and Die () equivalent exit () function outputs a message and exits the current script.
<?php
$nextweek =time () + (7*24*60*60);
Echo ' Now: '. Date (' y-m-d '). " \ n ";
Echo ' Next Week: '. Date (' y-m-d ', $nexWeek). " \ n ";
?>
Get today's date with next week's date
A static member is a class, and a normal member belongs to an object.
Define functions: Function Show ($a =1, $b) {}
Add John to the users array
$users []= "John";
Array_push ($users, "John");
$users ["AA"]= "John";
The @ symbol can block hints
10/4=2.5 because PHP is a weakly typed language
$attr =array (1,2,3,4);
while (list ($key, $value) = each ($attr))
{
echo $key. " = ". $value." <br> ";
}
while (list ($key, $value) = each ($attr))
{
echo $key. " = ". $value." <br> ";
}
How many rows of data will be output!
The each () function returns the key name and key value of the current element and moves the internal pointer forward.
The key name and key value of the element are returned in an array with four elements. Two elements (1 and value) contain key values, and two elements (0 and key) contain key names.
No data is executed, so the second while does not execute 4 rows of data.
$attr represents an array, the length of the array can be obtained by using count
PHP Error Collation