This is my first php program!



Download 6,9 Mb.
Pdf ko'rish
bet23/69
Sana26.02.2022
Hajmi6,9 Mb.
#471647
1   ...   19   20   21   22   23   24   25   26   ...   69
Bog'liq
PHP

30
|
Chapter 2: Language Basics
Use the
is_null( )
function to test whether a value is
NULL
—for instance, to see
whether a variable has a value:
if (is_null($x)) {
// $x is NULL
}
Variables
Variables in PHP are identifiers prefixed with a dollar sign (
$
). For example:
$name
$Age
$_debugging
$MAXIMUM_IMPACT
A variable may hold a value of any type. There is no compile- or runtime type check-
ing on variables. You can replace a variable’s value with another of a different type:
$what = "Fred";
$what = 35;
$what = array('Fred', '35', 'Wilma');
There is no explicit syntax for declaring variables in PHP. The first time the value of
a variable is set, the variable is created. In other words, setting a variable functions as
a declaration. For example, this is a valid complete PHP program:
$day = 60 * 60 * 24;
echo "There are $day seconds in a day.\n";
There are 86400 seconds in a day.
A variable whose value has not been set behaves like the
NULL
value:
if ($uninitialized_variable === NULL) {
echo "Yes!";
}
Yes
Variable Variables
You can reference the value of a variable whose name is stored in another variable.
For example:
$foo = 'bar';
$$foo = 'baz';
After the second statement executes, the variable
$bar
has the value
"baz"
.
Variable References
In PHP, references are how you create variable aliases. To make
$black
an alias for
the variable
$white
, use:
$black =& $white;
,ch02.15294 Page 30 Wednesday, March 13, 2002 11:42 AM


This is the Title of the Book, eMatter Edition
Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Download 6,9 Mb.

Do'stlaringiz bilan baham:
1   ...   19   20   21   22   23   24   25   26   ...   69




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish