Php Basics-constant-variable-related basic functions-PHP Tutorial

Source: Internet
Author: User
Tags constant definition php basics
Php Basics-constant-basic functions related to variables. Php Basics-constant-variable-related basic function annotation statement line # single line * multi-line comment *** document comment ** constant-defined custom Constant name case-sensitive system php Basics -constant-basic functions related to variables
Comment statement


// Single row


# Single row


/*
Multi-line comment
*/


/**
* Document comment
*
*/


Constant definition


Custom constant name case sensitive
The magic constant of the system is case insensitive _ DIR _ dir __




Variable definition
Variable names are case sensitive
The variable name must start with the $ symbol and comply with the naming rules of the variable name.






$ I;
Var_dump ($ I );


$ I = 'OK ';
Var_dump ($ I );




$ I = "Hello ";
Var_dump ($ I );




$ I = 20;
Var_dump ($ I );




USD I = 20.5;
Var_dump ($ I );


// The variable type is similar to the javascript variable type and is a variant type.
$ I = true;
Var_dump ($ I );






The function name and class name are case-insensitive.






Basic php functions


Phpinfo ();
Var_dump ($ I );
Echo gettype ($ I );
Define ('age', 200 );
Defined ('age ');


Realpath ()
Dirname ();

Comment statement // Single line # single line/* multi-line comment * // *** document comment **/constant definition custom Constant name case sensitive system...

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.