Home >Backend Development >PHP Tutorial >Learn PHP(2) step by step - PHP types_PHP tutorial

Learn PHP(2) step by step - PHP types_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:40:44993browse

1. About case
PHP’s built-in functions and structures are not case-sensitive.
For example:

Copy code The code is as follows:



HelloPHP


echo("Hello PHP");
ECHO("Hello PHP");
Echo("Hello PHP");
?>



The three The effect is the same.
Others, user-defined class names and method names are also case-insensitive.
For example:

Copy code The code is as follows:


HelloPHP


function Test()
{
echo ("Hello PHP");
}
Test();
TEST();
test();
?>

< ;/html>

But variables are case-sensitive.
image
2. Variables
I just want to mention one thing here. Anyone who has even a little contact with PHP will know that PHP declared variables start with the dollar sign ($).
In the previous example, we can also see this.
3. Type judgment function
In PHP, there are eight data types: integer, floating point, string, Boolean, array, object, NULL and resource. type.
There is a very important function when judging the type, the format is is_XX.
For example:
Copy code The code is as follows:

$intTest=1;
echo(is_int($intTest));
echo("
");
$stringTest="Test";
echo(is_string($stringTest));
echo("
");
echo(is_int($stringTest));
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321311.htmlTechArticle1. About case PHP’s built-in functions and structures are not case-sensitive. For example: Copy the code The code is as follows: html head titleHelloPHP/title /head body ?php echo("Hello PHP"); ECHO("H...
Statement:
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