PHP Basics-1

Source: Internet
Author: User

echo "Hello", "AAAA";//output syntax, multiple strings can be output
print "World"; can be output, can only output a string with "." Splicing can be output, with "," Splicing direct error


Data type Int,double,float,string,char,datetime,bool
PHP Weak type language
Variable definition 1. No add type required; 2. Start with $
all variables in PHP start with the $ sign

Variable variable


$a = 5;
echo isset ($a);//Determine if the variable is defined; 0 or null in PHP means false

unset ($a);//Clear variable


Empty ($a);//Determine if the variable is an empty array

$b =& $a; & Take Address

$a = 5;
Var_dump ($a);//Output variable details


$b = (string) $a;//Type conversion
Var_dump ($b);



. is stitching (stitching string)

The "/" default string, so the integer in addition to the integer automatically converted to a string, the result appears decimal, need attention

"A +"


echo $a;//error suppressor, can block hint error

echo 5==5? " Male ":" NV "//Three mesh operator

PHP Basics-1

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.