This is my first php program!



Download 6,9 Mb.
Pdf ko'rish
bet19/69
Sana26.02.2022
Hajmi6,9 Mb.
#471647
1   ...   15   16   17   18   19   20   21   22   ...   69
Bog'liq
PHP

26
|
Chapter 2: Language Basics
A single-quoted string only recognizes
\\
to get a literal backslash and
\'
to get a lit-
eral single quote:
$dos_path = 'C:\\WINDOWS\\SYSTEM';
$publisher = 'Tim O\'Reilly';
echo "$dos_path $publisher\n";
C:\WINDOWS\SYSTEM Tim O'Reilly
To test whether two strings are equal, use the
==
comparison operator:
if ($a == $b) { echo "a and b are equal" }
Use the
is_string( )
function to test whether a value is a string:
if (is_string($x)) {
// $x is a string
}
PHP provides operators and functions to compare, disassemble, assemble, search,
replace, and trim strings, as well as a host of specialized string functions for working
with HTTP, HTML, and SQL encodings. Because there are so many string-manipula-
tion functions, we’ve devoted a whole chapter (Chapter 4) to covering all the details.
Booleans
A boolean value represents a “truth value”—it says whether something is true or not.
Like most programming languages, PHP defines some values as true and others as
false. Truth and falseness determine the outcome of conditional code such as:
if ($alive) { ... }
In PHP, the following values are false:
• The keyword
false
• The integer
0
• The floating-point value
0.0
\r
Carriage return
\t
Tab
\\
Backslash
\$
Dollar sign
\{
Left brace
\}
Right brace
\[
Left bracket
\]
Right bracket
\0
through
\777
ASCII character represented by octal value
\x0
through
\xFF
ASCII character represented by hex value
Table 2-2. Escape sequences in double-quoted strings (continued)
Escape sequence
Character represented
,ch02.15294 Page 26 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   ...   15   16   17   18   19   20   21   22   ...   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