16 7090 Glossary 7/16/04 8:45 AM Page 224
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Symbols
!== (identity) operator, code writing
guidelines, 190
++ (prefix incrementing) operator, 15
— (prefix decrementing) operator, 15
== (is equal) operator, 90
=== (identity) operator, 90
code writing guidelines, 190
A
addition (+) operator, 15
aggregate functions, 152
AVG( ), 152
COUNT( ), 152
MAX( ), 152
MIN( ), 152
AND operator (logical), 18
applications, scripts
elements of, 6
sample, 7
tags, 7-8
arbitrary offsets, substrings, matching,
92-93
arguments in functions
func_get_arg( ), 31-32
func_num_arg( ), 31-32
arithmetic operators
addition (+), 15
division (/), 15
multiplication (*), 15
sorting, 78-81
navigating, 68-71
overview, 61
randomizing, 81-82
serializing, 85-86
values, assigning to multiple variables,
65-66
array_change_key_case( ) function, 74
array_diff( ) function, 85
array_diff_assoc( ) function, 85
array_intersect( ) function, 84-85
array_keys( ) function, 72
array_keys_exists( ) function, 73
array_merge( ) function, 82-84
array_multisort( ) function, 78-81
array_rand( ) function, 81-82
array_walk( ) function, 71
arsort( ) function, 77-78
asort( ) function, 77-78
Index
17 7090 index 7/16/04 8:43 AM Page 225
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
226
assigning
assigning
values to elements via array operator ([ ]),
64
variables by reference, 38-42
assignment operator, 14
associativity in operators, 19-20
class constructs, declaration of, 36-37
classes
declaring (class construct), 36-37
encapsulation, 35
function of, 36
inheritance, 35
implementation process, 42-44
instantiating (new operator), 37
as namespaces, 37-38
client-side processing
JavaScript example, 50-51
versus server-side processing, 50-51
closing
file wrappers, 162
files via fclose( ) function, 107
sockets, 171
closing tags, 7-8
code
debugger types, 193
flattening of if statements, 187-188
logical groupings, 186
optimization, caching techniques, 196-197
program documentation, 186
whitespace, 186
writing
command splitting over multiple lines, 188
embedding of if statements, 191-192
predefined standards, 186
tag styles, 189
testing for resource allocation, 190-191
alternative syntax, 22
short form syntax, 22
overview, 21-22
17 7090 index 7/16/04 8:43 AM Page 226
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
227
DBMSs
connecting remote hosts via sockets,
166-167
constants
creating via define ( ) construct, 14
function of, 14
context (streams), creating, 165
continue statement in loop structures,
28
cookies
headers, 54-55
session management, 56-57
transaction process, 54-55
Coordinated Universal Time (CUT), 116
copy( ) function, use with file wrappers,
163
copying files via fcopy( ) function, 110
count( ) function, 152
array elements, counting, 65
CREATE TABLE statement (DBMSs),
149
cross-site scripting (XSS), security
issues, 180
D
values, declaration methods, 10-11
variables, substitution in strings, 13
data filtering
blacklist approach, 178
whitelist approach, 178
database administrators (DBAs), indices
optimization, 147
database management servers. See
DBMSs
databases
data impurities, 153-154
date handling, 154
escape sequences, 153-154
indices
foreign keys, 148
good writing rules, 147
primary keys, 148
information, sorting (ORDER BY
clause), 152-153
optimization measures
query limits, 195
table indexes, 195-196
resultsets, grouping, 151-152
shell command injections, security
vulnerabilities, 180
SQL injections, security vulnerabilities,
179
table indices, 147
date arrays, 115
element keys, 116
transactions
COMMIT TRANSACTION command,
153
creating, 153
ROLLBACK TRANSACTION
command, 153
debuggers, 193
debugging code, resource allocations,
190-191
declaring
classes (class construct), 36-37
functions, 28
string values
double quotes, 10
heredoc syntax, 11
single quotes, 10
define( ) construct, constants, creating,
14
DELETE statement, table rows, deleting,
149-150
deleting files with unlink( ) function,
111
delivering email, troubleshooting issues,
139-140
difference (!=) operator, 17
differences in arrays, calculating, 85
division (/) operator, 15
do-while statement in loop structures,
26
documentation in code writing
examples, 129
security holes, 130
messages, formatting, 133-135
PHP scripts
sending on Netware computers, 131-132
sending on UNIX computers, 130-131
sending on Windows computers, 131-132
plain-text, sending, 133-134
RFC series of documents, 140
SASL, 129
sending (mail( ) function), 132
SMTP, 128
spam, 129
subjects, setting, 133
embedding if statements, code writing
guidelines, 191-192
encapsulation (classes), 35
equality (==) operator, 17
equals sign (=) operator, code writing
guidelines, 189-190
error messages, displaying in browsers,
security dangers, 192-193
error suppression operators, preventing
error message display in browsers,
192-193
error-control operators, 16-17
escape sequences, 10, 153-154
escapeshellcmd( ) function, 180
17 7090 index 7/16/04 8:43 AM Page 228
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
from strings, 95-96
via regular expressions, 100-101
formatted data from strings, 96-97
keys from arrays, 72
table data from multiple tables, 150-151
F
fclose( ) function, 171
files, closing, 107
fcopy( ) function, files, copying, 110
fflush( ) function, flushing output to
files, 108
fgets( ) function, reading files single line
at time, 107-108
file handles, 166
file wrappers
built-in, 158-160
closing, 162
copy( ) function, 163
file( ) function, 163
file_get_contents( ) function, 163
filesystem functions, 162
function of, 158
readfile( ) function, 163
selecting, 158-159
supported operations, 161
allows appending, 160
allows reading, 160
allows simultaneous reading and writing,
161
allows writing, 160
moving (rename( ) function), 111
opening (fopen( ) function), 106-107
outputting (fpassthru( ) function), 108
ownership, changing (chown( ) function),
111
reading (fread( ) function), 107
reading (readfile( ) function), 112
How can we make this index more useful? Email us at
17 7090 index 7/16/04 8:43 AM Page 229
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
230
files
reading single line at time (fgets( )
function), 107-108
shortcut functions, 109
fileatime( ), 110
fileatype( ), 110
filectime( ), 110
filegroup( ), 110
fileinode( ), 110
filemtime( ), 110
fileowner( ), 110
fileperms( ), 110
files_exists( ), 110
filesize( ), 110
is_dir( ), 110
is_executable( ), 110
is_file( ), 110
is_link( ), 110
is_readable( ), 110
function of, 51
fpassthru( ) function, files, outputting,
108
fread( ) function, 107
From header (email), 133
fsockopen( ) function, 167-168
fstats( ) function, file information
retrieval, 109
functions, 109
aggregate
AVG( ), 152
COUNT( ), 152
MAX( ), 152
MIN( ), 152
array( ), 62-63
array_change_key_case( ), 74
array_diff( ), 85
array_diff_assoc( ), 85
array_intersect, 84-85
array_keys( ), 72
array_keys_exists( ), 73
array_merge, 82-84
array_multisort( ), 78-81
array_rand( ), 81-82
array_walk( ), 71
arsort( ), 77-78
asort( ), 77-78
chgrp( ), 111
chmod( ), 111
count( ), 65
fsockopen( ), 167-168
fstats( ), 109
fwrite( ), 108-109
getdate( ), 117-118
gettimeofday( ), 117
htmlentities( ), 180
htmlspecialchars( ), 180
is_dir( ), 110
is_executable( ), 110
is_file( ), 110
is_link( ), 110
is_readable( ), 110
is_uploaded_file( ), 110
is_writable( ), 110
krsort( ), 74-76
ksort( ), 74-76
list( ), 65-66
localtime( ), 118-119
mail( ), 132, 139
mktime( ), 123
names, assigning, 29
parameters
default values, 29
passing by reference, 29
receiving, 29
variable number of, 31-32
pfsockopen( ), 167-168
preg_replace( ), 101
preg_split( ), 101-102
printf( ), 93-95
variable scope, 30-31
func_get_arg( ) function, 31-32
func_num_arg( ) function, 31-32
fwrite( ) function, writing to files,
108-109
G - H
getdate( ) function, date array retrieval,
117-118
gettimeofday( ) function, UNIX time
stamp retrieval, 117
greater than (>) operator, 17
greater than or equal (=>) operator, 17
Greenwich Mean Time (GMT), 116
groups of files, changing (chgrp( )
function), 111
hardware, performance optimization
measures, 193-194
headers (email)
Bcc, 133
Cc, 133
From, 133
headers (HTTP), cookies, 54-55
heredoc syntax, declaration of string
values, 11
HTML (Hypertext Markup Language)
email
attached images, sending, 137-139
security dangers, 130
sending, 134-135
forms, function of, 51