This is my first php program!



Download 6,9 Mb.
Pdf ko'rish
bet15/69
Sana26.02.2022
Hajmi6,9 Mb.
#471647
1   ...   11   12   13   14   15   16   17   18   ...   69
Bog'liq
PHP

Lexical Structure
|
21

*/
echo("l=$l m=$m n=$n\n");
?>
Now this is regular HTML...
l=12 m=13 n=

Now this is regular HTML...

You can indent, or not indent, comments as you like:
/* There are no
special indenting or spacing
rules that have to be followed, either.
*/
C-style comments can be useful for disabling sections of code. In the following exam-
ple, we’ve disabled the second and third statements by including them in a block
comment. To enable the code, all we have to do is remove the comment markers:
$f = 6;
/* $g = 7; # This is a different style of comment
$h = 8;
*/
However, you have to be careful not to attempt to nest block comments:
$i = 9;
/* $j = 10; /* This is a comment */
$k = 11;
Here is some comment text.
*/
In this case, PHP tries (and fails) to execute the (non-)statement
Here is some comment
text
and returns an error.
Literals
A literal is a data value that appears directly in a program. The following are all liter-
als in PHP:
2001
0xFE
1.4142
"Hello World"
'Hi'
true
null
Identifiers
An identifier is simply a name. In PHP, identifiers are used to name variables, func-
tions, constants, and classes. The first character of an identifier must be either an
,ch02.15294 Page 21 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.
22
|
Chapter 2: Language Basics
ASCII letter (uppercase or lowercase), the underscore character (
_
), or any of the
characters between ASCII 0x7F and ASCII 0xFF. After the initial character, these
characters and the digits 0–9 are valid.
Variable names
Variable names always begin with a dollar sign (
$
) and are case-sensitive. Here are
some valid variable names:
$bill
$head_count
$MaximumForce
$I_HEART_PHP
$_underscore
$_int
Here are some illegal variable names:
$not valid
$|
$3wa
These variables are all different:
$hot_stuff $Hot_stuff $hot_Stuff $HOT_STUFF
Function names
Function names are not case-sensitive (functions are discussed in more detail in
Chapter 3). Here are some valid function names:
tally
list_all_users
deleteTclFiles
LOWERCASE_IS_FOR_WIMPS
_hide
These function names refer to the same function:
howdy HoWdY HOWDY HOWdy howdy
Class names
Class names follow the standard rules for PHP identifiers and are not case-sensitive.
Here are some valid class names:
Person
account
The class name
stdClass
is reserved.
Constants
A constant is an identifier for a simple value; only scalar values—boolean, integer,
double, and string—can be constants. Once set, the value of a constant cannot
,ch02.15294 Page 22 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   ...   11   12   13   14   15   16   17   18   ...   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