PHP First Talk

Source: Internet
Author: User
Tags fdf

<?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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.