<?php
Hhha
/* */
Empty is used to detect if the variable is empty
PHP is a weakly typed language that determines variable types based on stored values.
Define variable with $ start followed by variable name
The naming specification of the variable name is the same as C # (the letter _ begins, can contain _ alphanumeric), is case-sensitive, PHP supports Chinese variables
PHP's functions are case-insensitive
PHP statement with; end
Var_dump print out the incoming worth type length, * man takes two characters
. Equivalent to the connection effect
/* $d = "dd\n";
if (empty ($d)) {
echo "DDD";
}else{
Echo $d;
}
Var_dump ($d);
$ hope = "";
Var_dump ($ hope);
*/
$webName = "Wang";
$ $webName = "DD";
echo $ $webName. " ----". $wang
/*
Post file upload limit in php.ini
//
$_get[] Address bar $_post[] $_request[]//can accept POST or get at the same time, the disadvantage is slow
; Maximum size of POST data that PHP would accept.
; Its value is 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; Http://php.net/post-max-size
Post_max_size = 3M
; Maximum allowed size for uploaded files.
; Http://php.net/upload-max-filesize
Upload_max_filesize = 64M
Upload_max_filesize upload via post, less than post
Post to be less than
; Maximum amount of memory a script may consume (128MB)
; Http://php.net/memory-limit
Memory_limit = 128M
*/
/*
$w = "Nihao";
$s = $w;//value passing mode, creating two variables
$w = "FDF";
echo $w;
Echo $s;
echo "<br/>";
$s =& $w;//reference delivery method
echo $w;
Echo $s;
*/
Data constants
/*
Echo M_pi;//pi
echo php_os;//Output Operating system
Echo __line__;//as you move forward
Echo __file__;//location on the server
function FD () {
Echo __line__;
Echo __function__; Returns the function name;
}
FD ();
Class mm{
function DD () {
Echo __class__;//return class name
echo "<br/>";
Echo __method__;//Return method name
}
}
$obj =new MM ();
$obj->dd ();
*/
Isset function to determine whether a function exists
$setV = Isset ($www);
$setV = "FDF";
if ($setV) {
echo "Variable exists";
}else{
echo "Variable does not exist";
}
Defining constants
Define ("Li", "DFDF");
Var_dump (defined (' Li '));
if (defined (' Li ')) {
Echo Li;
}
else{
echo "Constant does not exist";
}
?>
PHP First Talk