Skip to Content
PHP编程:第4版
book

PHP编程:第4版

by Kevin Tatroe, Peter MacIntyre
January 2021
Intermediate to advanced
505 pages
9h 45m
Chinese
Publishing House of Electronics Industry
Content preview from PHP编程:第4版
30
2
语言基础
call_user_func($callback);
NULL
NULL
数据类型只有一个值。这个值可以通过不区分大小写的关键字
NULL
获得。
NULL
值表示一个变量没有值(类似
Perl
中的
undef
Python
中的
None
):
$aleph = "beta";
$aleph = null; //
变量的值已经没有了
$aleph = Null; //
一样的效果
$aleph = NULL; //
一样的效果
可使用
is_null()
函数来测试一个值是否为
NULL
,例如,查看一个变量是否有值
if (is_null($x)) {
// $x
NULL
}
变量
PHP
中的变量是指用一个美元符号(
$
)作为前缀的标识符。例如
$name
$Age
$_debugging
$MAXIMUM_IMPACT
变量可以存放任意类型的值。在编译或运行时没有变量的类型检查,你可以用其他不同
类型的值替换一个变量的值
$what = "Fred";
$what = 35;
$what = array("Fred", 35, "Wilma");
PHP
中不需要用显式的语法来声明变量。变量第一次被赋值的时候,该变量就在内存
中被创建。换句话说,设置变量的值也有声明变量的功能。例如,下面的代码在
PHP
序中是完全合法的
$day = 60 * 60 * 24;
echo "There are {$day} seconds in a day.";
There are 86400 seconds in a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley
算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez

Publisher Resources

ISBN: 9787121404634