search
Homephp教程php手册一步一步学习PHP(2)——PHP类型_php基础

1. 关于大小写
PHP内置的函数和结构是不区分大小写的。
如:
复制代码 代码如下:



HelloPHP


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



这三者的效果是一样的。
其他,用户自定义的类名和方法名也是不区分大小写的。
例如:

复制代码 代码如下:



HelloPHP


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



但是变量是区分大小写的。
image 
2. 变量
这里只提一句,哪怕稍微接触过一些PHP的人都会知道,PHP声明变量以美元符($)开头。
在前面的例子中,我们也可以看到。
3. 类型判断函数
在PHP中,一共有八种数据类型:分别为整型,浮点型,字符串,布尔型,数组,对象,NULL和资源类型。
判断类型时有一个很重要的函数,格式为is_XX。
例如:
复制代码 代码如下:

$intTest=1;
echo(is_int($intTest));
echo("
");
$stringTest="Test";
echo(is_string($stringTest));
echo("
");
echo(is_int($stringTest));
?>
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools