This is my first php program!



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

20
|
Chapter 2: Language Basics
C++ comments
When PHP encounters two slash characters (
//
) within the code, everything from the
slashes to the end of the line or the end of the section of code, whichever comes first,
is considered a comment. This method of commenting is derived from C++. The
result is the same as the shell comment style.
Here are the shell-style comment examples, rewritten to use C++ comments:
////////////////////////
// Cookie functions
////////////////////////
if ($double_check) {
// create an HTML form requesting that the user confirm the action
echo confirmation_form( );
}
$value = $p * exp($r * $t); // calculate compounded interest
Then another
Then another 4
C comments
While shell- and C++-style comments are useful for annotating code or making short
notes, longer comments require a different style. As such, PHP supports block com-
ments, whose syntax comes from the C programming language. When PHP encoun-
ters a slash followed by an asterisk (
/*
), everything after that until it encounters an
asterisk followed by a slash (
*/
) is considered a comment. This kind of comment,
unlike those shown earlier, can span multiple lines.
Here’s an example of a C-style multiline comment:
/* In this section, we take a bunch of variables and
assign numbers to them. There is no real reason to
do this, we're just having fun.
*/
$a = 1; $b = 2; $c = 3; $d = 4;
Because C-style comments have specific start and end markers, you can tightly inte-
grate them with code. This tends to make your code harder to read, though, so it is
frowned upon:
/* These comments can be mixed with code too,
see? */ $e = 5; /* This works just fine. */
C-style comments, unlike the other types, continue past end markers. For example:
$l = 12;
$m = 13;
/* A comment begins here
?>
Some stuff you want to be HTML.
,ch02.15294 Page 20 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   ...   10   11   12   13   14   15   16   17   ...   69




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
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