PHP Basic Syntax

Source: Internet
Author: User

<?php

/*
echo "Hello", "AAA"; Output statements that can output multiple strings
print "World"; Only one string can be output

*/

PHP is a weakly typed language

/* $a = 5; PHP defines variables, starting with $
echo $a; */

/* $a = "hell0";
$hello = "World";
echo $ $a;//mutable variable
*/

$a = 5;
echo isset ($a); Determines whether a variable is defined.

unset ($a); Clear variables

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

/* $a = 5;
$b =& $a;//Take Address
$b = 10;
echo $a;
*/

/* $a = 5;
Var_dump ($a);//Output variable details
$b = (string) $a;//Type conversion
*/

/* $a = 10;
$b = 3;
echo $a/$b; */

echo "Hello". " Word ";//splicing string with". "No +

echo @ $a;//error suppressor, can mask error

/*echo true? " Male ":" Female "; Trinocular operator
echo 5==5? " Male ":" Female ";
*/


?>

PHP Basic Syntax

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.