PHP basics - constants - basic functions related to variables_PHP tutorial

WBOY
Release: 2016-07-13 10:18:08
Original
1056 people have browsed it

php basics-constants-variable related basic functions

Comment statement


//Single line


# Single line


/*
Multi-line comments
*/


/**
* Documentation comments
*
*/


Constant definition


Custom constants constant names are case-sensitive
The system's magic constants are not case-sensitive __DIR__ __dir__




Variable definition
Variable names are case sensitive
When declaring a variable name, start with the $ symbol and comply with the naming rules for variable names






$i;
var_dump($i);


$i = 'ok';
var_dump($i);




$i = "Hello";
var_dump($i);




$i = 20;
var_dump($i);




$i = 20.5;
var_dump($i);


//Variable type is similar to javascript variable type, it is a variant type
$i = true;
var_dump($i);






Function name, class name, case-insensitive






PHP basic functions


phpinfo();
var_dump($i);
echo gettype($i);
define('AGE',200);
defined('AGE');


realpath()
dirname();

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/885674.htmlTechArticlephp basic-constant-variable-related basic function comment statements //Single line # Single line /* Multi-line comments*/ /***Documentation comments**/ Constant definition custom constant constant name case-sensitive system...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!