Zend PHP Certification Study Guide- P13

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:20

0
48
lượt xem
17
download

Zend PHP Certification Study Guide- P13

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Zend PHP Certification Study Guide- P13: Hãy thẳng thừng, Giả sử bạn đang thuê một ai đó để giám sát hệ thống và PHP của bạn có nó thu hẹp xuống để hai ứng cử viên. Một trong những ứng cử viên nói, "Oh yeah, tôi biết tất cả về PHP." Các ứng cử viên khác nói, "Oh yeah, tôi biết tất cả về PHP, tôi đã được thông qua kỳ thi chứng chỉ Zend." câu hỏi tiếp theo của bạn có thể sẽ là "Zend Chứng nhận là gì?" Và các ứng viên nói, "Một công ty chuyên về...

Chủ đề:
Lưu

Nội dung Text: Zend PHP Certification Study Guide- P13

  1. Index Symbols arrays array operator ([ ]) !== (identity) operator, code writing assigning values to elements, 64 guidelines, 190 elements, 63 ++ (prefix incrementing) operator, 15 common elements, intersection of, 84-85 — (prefix decrementing) operator, 15 creating == (is equal) operator, 90 with array ([ ]) operator, 64-65 === (identity) operator, 90 with array( ) function, 62-63 code writing guidelines, 190 differences, calculating, 85 elements A checking for existence of, 73 counting, 65 addition (+) operator, 15 keys, 11 aggregate functions, 152 files, converting with file( ) function, 112 AVG( ), 152 functions, manipulating, 76-78 COUNT( ), 152 keys MAX( ), 152 case, changing, 74 MIN( ), 152 extracting from other arrays, 72 AND operator (logical), 18 manipulating, 72-76 applications, scripts sorting by, 74-76 elements of, 6 merging, 82-84 sample, 7 multidimensional, 66-68 tags, 7-8 sorting, 78-81 arbitrary offsets, substrings, matching, navigating, 68-71 92-93 overview, 61 arguments in functions randomizing, 81-82 func_get_arg( ), 31-32 serializing, 85-86 func_num_arg( ), 31-32 values, assigning to multiple variables, arithmetic operators 65-66 addition (+), 15 array_change_key_case( ) function, 74 division (/), 15 array_diff( ) function, 85 multiplication (*), 15 array_diff_assoc( ) function, 85 prefix decrementing (—), 15 array_intersect( ) function, 84-85 prefix incrementing (++), 15 array_keys( ) function, 72 subtraction (-), 15 array_keys_exists( ) function, 73 array( ) function, 62-63 array_merge( ) function, 82-84 array operator ([]) arrays, creating, 64-65 array_multisort( ) function, 78-81 elements, 63 array_rand( ) function, 81-82 assigning values to, 64 array_walk( ) function, 71 arsort( ) function, 77-78 asort( ) function, 77-78
  2. 226 assigning assigning closing values to elements via array operator ([ ]), file wrappers, 162 64 files via fclose( ) function, 107 variables by reference, 38-42 sockets, 171 assignment operator, 14 closing tags, 7-8 associativity in operators, 19-20 code attachments (email) debugger types, 193 images, sending (HTML), 137-139 flattening of if statements, 187-188 text files, sending, 135-139 logical groupings, 186 auto_detect_line_endings setting optimization, caching techniques, 196-197 (php.ini file), 162 program documentation, 186 AVG( ) function, 152 whitespace, 186 writing command splitting over multiple lines, 188 B-C embedding of if statements, 191-192 Bcc header (email), 133 predefined standards, 186 bitwise operators, 16 tag styles, 189 blacklist approach, data filtering, 178 testing for resource allocation, 190-191 blocking mode (sockets), 169-170 use of concatenation operator, 188-189 Boolean values, true/false conditions, 11 use of condition statements, 189-190 built-in file wrappers, 159-160 use of identity operators, 190 bytecode caches columns (tables), data types, 146 commercial, 197 combined assignment operators, 19 function of, 196-197 comments (exam), entering, 204 open-source, 197 COMMIT TRANSACTION command, 153 caching solutions, code optimization, comparing strings 196-197 via comparison operators, 90 callback function, walking through via strcasecmp( ) function, 91 arrays, 71 via strcmp( ) function, 91 case of array keys, changing, 74 comparison operators, 17-18 case statement, 23-25 == (is equal), 90 Cc header (email), 133 === (is identical), 90 chgrp( ) function, file groups, changing, difference (!=), 17 111 equality (==), 17 chmod( ) function, file modes, greater than (>), 17 changing, 111 greater than or equal (=>), 17 chown( ) function, file ownership, less than (
  3. DBMSs 227 connecting remote hosts via sockets, precedence, 19-20 166-167 string, 17 constants typecasting, 19 creating via define ( ) construct, 14 resource values, 12 function of, 14 strings context (streams), creating, 165 extracting, 95-96 continue statement in loop structures, values, declaration methods, 10-11 28 variables, substitution in strings, 13 cookies data filtering headers, 54-55 blacklist approach, 178 session management, 56-57 whitelist approach, 178 transaction process, 54-55 database administrators (DBAs), indices Coordinated Universal Time (CUT), 116 optimization, 147 copy( ) function, use with file wrappers, database management servers. See 163 DBMSs copying files via fcopy( ) function, 110 databases count( ) function, 152 data impurities, 153-154 array elements, counting, 65 date handling, 154 CREATE TABLE statement (DBMSs), escape sequences, 153-154 149 indices cross-site scripting (XSS), security foreign keys, 148 issues, 180 good writing rules, 147 primary keys, 148 information, sorting (ORDER BY D clause), 152-153 data optimization measures arrays, 11 query limits, 195 Boolean values, true/false conditions, 11 table indexes, 195-196 constants resultsets, grouping, 151-152 creating via define ( ) construct, 14 shell command injections, security function of, 14 vulnerabilities, 180 containment via variables, 12 SQL injections, security vulnerabilities, extraction via regular expressions, 100-101 179 forms, handling via superglobal arrays, table indices, 147 51-54 date arrays, 115 manipulation of, 9-12 element keys, 116 NULL type, 11 retrieving, 117-119 numeric types date formats integer, 9-10 date arrays, 115-116 real, 9-10 string-formatted dates, 115-116, 119-123 operators, 14 UNIX time stamps, 115-116 arithmetic, 15 date( ) function, formatting tokens, assignment, 14 119-120 associativity, 19-20 DBMSs (database management servers), 145 bitwise, 16 escape sequences, 153-154 combined assignment, 19 indices comparison, 17-18 foreign keys, 148 error-control, 16-17 good writing rules, 147 logical, 18 primary keys, 148 How can we make this index more useful? Email us at indexes@samspublishing.com
  4. 228 DBMSs information, retrieving (SELECT E statement), 150 relational databases, 146 elements in arrays resultsets, grouping (GROUP BY clause), checking for existence of, 73 151-152 counting, 65 tables email creating, 149 delivery of, 127 data, extracting, 150-151 troubleshooting, 139-140 indices, 147 domains, MX records, 128 rows, deleting, 149-150 file attachments, 135-139 rows, inserting, 149 headers transactions Bcc, 133 COMMIT TRANSACTION command, Cc, 133 153 From, 133 creating, 153 HTML ROLLBACK TRANSACTION attached images, sending, 137-139 command, 153 security dangers, 130 debuggers, 193 sending, 134-135 debugging code, resource allocations, junk filters, 130 190-191 Mail Transport Agent (MTA) examples, declaring 128 classes (class construct), 36-37 Mail User Agent (MUA) functions, 28 examples, 129 string values security holes, 130 double quotes, 10 messages, formatting, 133-135 heredoc syntax, 11 PHP scripts single quotes, 10 sending on Netware computers, 131-132 define( ) construct, constants, creating, sending on UNIX computers, 130-131 14 sending on Windows computers, 131-132 DELETE statement, table rows, deleting, plain-text, sending, 133-134 149-150 RFC series of documents, 140 deleting files with unlink( ) function, SASL, 129 111 sending (mail( ) function), 132 SMTP, 128 delivering email, troubleshooting issues, spam, 129 139-140 subjects, setting, 133 difference (!=) operator, 17 embedding if statements, code writing differences in arrays, calculating, 85 guidelines, 191-192 division (/) operator, 15 encapsulation (classes), 35 do-while statement in loop structures, equality (==) operator, 17 26 equals sign (=) operator, code writing documentation in code writing guidelines, 189-190 (PHPDocumentor tool), 186 error messages, displaying in browsers, dollar sign ($) syntax (variables), 13 security dangers, 192-193 domains error suppression operators, preventing email servers, MX records, 128 error message display in browsers, unique number of, 5 192-193 double quotes, string values, declaration error-control operators, 16-17 of, 10 escape sequences, 10, 153-154 dynamic data, performance escapeshellcmd( ) function, 180 optimization measures, 194
  5. files 229 exam (Zend PHP Certification), 201 file( ) function, 163 answers, reviewing, 204 file_get_contents( ) function, 163 comments, entering, 204 filesystem functions, 162 instructions, 203 function of, 158 nondisclosure agreement (NDA), 203-204 readfile( ) function, 163 questions selecting, 158-159 fill-in-the-blank type, 207 supported operations, 161 multiple choice type, 205-206 allows appending, 160 navigating forward and backward, 204 allows reading, 160 number of, 203 allows simultaneous reading and writing, open type, 207 161 single choice type, 204-205 allows writing, 160 registering, 201 restricted by URL, 160 test center walk-in, 202 supports mkdir( ) function, 161 via Pearson VUE Call Center, 202 supports rename( ) function, 161 via Pearson VUE Web site, 202 supports rmfir( ) function, 161 test centers supports stat( ) function, 161 arrival time, 202 supports unlink( ) function, 161 ID requirements, 202 file( ) function locating, 201 files, converting to arrays, 112 materials provided, 203 use with file wrappers, 163 personal belongings, 202 fileatime( ) function, 110 time limit, 203 filectime( ) function, 110 explode( ) function, string splits, 101-102 filegroup( ) function, 110 expressions, output via tags, 8 fileinode( ) function, 110 external files, inclusion of, 8-9 filemtime( ) function, 110 extracting fileowner( ) function, 110 data fileperms( ) function, 110 from strings, 95-96 file_gets_contents( ) function, 113, 163 via regular expressions, 100-101 files formatted data from strings, 96-97 arrays, converting (file( ) function), 112 keys from arrays, 72 closing (fclose( ) function), 107 table data from multiple tables, 150-151 copying (fcopy( ) function), 110 deleting (unlink( ) function), 111 email attachments, 135-139 F external, inclusion of, 8-9 fclose( ) function, 171 flushing output to (fflush( ) function), 108 files, closing, 107 groups, changing (chgrp( ) function), 111 fcopy( ) function, files, copying, 110 information, retrieving (fstats( ) function), 109 fflush( ) function, flushing output to locking (flock( ) function), 111-112 files, 108 modes, changing (chmod( ) function), 111 fgets( ) function, reading files single line moving (rename( ) function), 111 at time, 107-108 opening (fopen( ) function), 106-107 file handles, 166 outputting (fpassthru( ) function), 108 file wrappers ownership, changing (chown( ) function), built-in, 158-160 111 closing, 162 reading (fread( ) function), 107 copy( ) function, 163 reading (readfile( ) function), 112 How can we make this index more useful? Email us at indexes@samspublishing.com
  6. 230 files reading single line at time (fgets( ) fpassthru( ) function, files, outputting, function), 107-108 108 shortcut functions, 109 fread( ) function, 107 fileatime( ), 110 From header (email), 133 fileatype( ), 110 fsockopen( ) function, 167-168 filectime( ), 110 fstats( ) function, file information filegroup( ), 110 retrieval, 109 fileinode( ), 110 functions, 109 filemtime( ), 110 aggregate fileowner( ), 110 AVG( ), 152 fileperms( ), 110 COUNT( ), 152 files_exists( ), 110 MAX( ), 152 filesize( ), 110 MIN( ), 152 is_dir( ), 110 array( ), 62-63 is_executable( ), 110 array_change_key_case( ), 74 is_file( ), 110 array_diff( ), 85 is_link( ), 110 array_diff_assoc( ), 85 array_intersect, 84-85 is_readable( ), 110 array_keys( ), 72 is_uploaded file( ), 110 array_keys_exists( ), 73 is_writable( ), 110 array_merge, 82-84 strings, reading into (file_get_contents( ) array_multisort( ), 78-81 function), 113 array_rand( ), 81-82 versus scripts, 8 array_walk( ), 71 writing to (fwrite( ) function), 108-109 arsort( ), 77-78 files_exists( ) function, 110 asort( ), 77-78 filesize( ) function, 110 chgrp( ), 111 filetype( ) function, 110 chmod( ), 111 fill-in-the-blank questions (exam), 207 count( ), 65 flattening if statements, code writing date( ), formatting tokens, 119-120 readability, 187-188 declaration of, 28 flock( ) function, files, locking, 111-112 escapeshellcmd( ), 180 flushing output to files (fflush( ) explode( ), 101-102 function), 108 fclose( ), 107, 171 fopen( ) function fcopy( ), 110 error messages, 106 fflush( ), 108 files, opening, 106-107 fgets( ), 107-108 modes, 106 file( ), 112 file_get_contents( ), 113 for loop, 26-27 fileatime( ), 110 arrays, navigating, 68-69 filectime( ), 110 foreach loop, arrays, navigating, 69-70 filegroup( ), 110 foreign keys, databases indices, 148 fileinode( ), 110 formatted data, string extraction, 96-97 filemtime( ), 110 formatting fileowner( ), 110 email messages, 133-134 fileperms( ), 110 strings, 93-95 files_exists( ), 110 forms filesize( ), 110 data, handling with superglobal arrays, filetype( ), 110 51-54 flock( ), 111-112 function of, 51
  7. HTML 231 fopen( ), 106-107 stream_set_blocking( ), 169-170 error messages, 106 stream_set_timeout( ), 170-171 modes, 106 stream_wrapper_register( ), 160 fpassthru( ), 108 strftime( ), formatting tokens, 121-123 fread( ), 107 strip_tags( ), 180 fsockopen( ), 167-168 strncasecmp( ), 92 fstats( ), 109 strncmp( ), 92 fwrite( ), 108-109 strstr( ), 92-93 getdate( ), 117-118 strtotime( ), 123-124 gettimeofday( ), 117 substr( ), 96 htmlentities( ), 180 substr_replace( ), 97 htmlspecialchars( ), 180 time( ), 117 is_dir( ), 110 unlink( ), 111 is_executable( ), 110 unserialize( ), 85-86 is_file( ), 110 variable functions, 32-33 is_link( ), 110 variable scope, 30-31 is_readable( ), 110 func_get_arg( ) function, 31-32 is_uploaded_file( ), 110 func_num_arg( ) function, 31-32 is_writable( ), 110 fwrite( ) function, writing to files, krsort( ), 74-76 108-109 ksort( ), 74-76 list( ), 65-66 localtime( ), 118-119 G-H mail( ), 132, 139 getdate( ) function, date array retrieval, mktime( ), 123 117-118 names, assigning, 29 gettimeofday( ) function, UNIX time parameters stamp retrieval, 117 default values, 29 greater than (>) operator, 17 passing by reference, 29 greater than or equal (=>) operator, 17 receiving, 29 Greenwich Mean Time (GMT), 116 variable number of, 31-32 groups of files, changing (chgrp( ) pfsockopen( ), 167-168 function), 111 preg_replace( ), 101 preg_split( ), 101-102 printf( ), 93-95 hardware, performance optimization readfile( ), 112 measures, 193-194 rename( ), 111 headers (email) reset( ), 70-71 Bcc, 133 rsort( ), 76-77 Cc, 133 serialize( ), 85-86 From, 133 set_error_handler( ), 192-193 headers (HTTP), cookies, 54-55 shown( ), 111 heredoc syntax, declaration of string sort( ), 76-77 values, 11 split( ), 101-102 HTML (Hypertext Markup Language) sscanf( ) function, 96-97 email str_replace( ), 97-98 attached images, sending, 137-139 strcasecmp( ), 91 security dangers, 130 strcmp( ), 91 sending, 134-135 stream_context_create( ), 165 forms, function of, 51 stream_get_meta_data( ), 164-165 tags, code readability standards, 189 How can we make this index more useful? Email us at indexes@samspublishing.com
  8. 232 htmlentities( ) function htmlentities( ) function, cross-site Internet Engineering Task Force (IETF) scripting prevention, 180 website, 172 htmlspecialchars( ) function, cross-site Internet Mail Consortium website, 140 scripting prevention, 180 IPs, unique number of, 5 HTTP (Hypertext Transfer Protocol) is equal (==) operator, 90 browser requests, 50 is identical (===) operator, 90 cookies is_dir( ) function, 110 headers, 54-55 is_executable( ) function, 110 session management, 56-57 is_file( ) function, 110 sessions, persistent data, 56-57 is_link( ) function, 110 Hypertext Markup Language. See HTML is_readable( ) function, 110 Hypertext Transfer Protocol. See HTTP is_uploaded_file( ) function, 110 is_writable( ) function, 110 I iteration structures, 25 continue statement, 28 identifiers do-while statement, 26 function of, 12 for loop, 26-27 naming conventions, 12 while statement, 25-26 validity of, 12 identity operators (===), code writing guidelines, 190 J-K if statements JavaScript, client-side processing, 50-51 embedding for code writing, 191-192 joining tables, 150-151 flattening for code writing purposes, 187-188 junk email filters, 130 if-then-else statement, 21-22 alternative syntax, 22 keys in arrays short form syntax, 22 case, changing, 74 include construct, 8-9 extracting from other arrays, 72 include once construct, 8-9 manipulating, 72-76 sorting by, 74-76 inclusion of external files, 8-9 krsort( ) function, array sorts by keys, indices (databases), 147 74-76 foreign keys, 148 good writing rules, 147 ksort( ) function, array sorts by keys, primary keys, 148 74-76 tables, 147 infinite loops, 25 L inheritance classes, 35 languages implementation process, 42-44 constructs inner joins, 150-151 include, 8-9 intersection in arrays, common include once, 8-9 elements, 84-85 require, 8-9 INSERT statement, table rows, require once, 8-9 inserting, 149 PHP functionality, 6 instantiating classes with new operator, leading substrings, matching, 92 37 less than (
  9. opening 233 list( ) function, assigning array values to multiple tables, joining, 150-151 multiple variables, 65-66 multiplication (*) operator, 15 localtime( ) function, date array Multipurpose Internet Mail Extensions retrieval, 118-119 (MIME), 134 locking files with flock( ) function, MX records, adding to email domains, 111-112 128 logical operators AND, 18 NOT, 18 N OR, 18 namespaces, treating classes as, 37-38 XOR, 18 navigating arrays, 68-71 loop structures, 25 Netware, email, sending, 131-132 continue statement, 28 network servers, remote hosts, do-while statement, 26 connecting via sockets, 166-167 for loop, 26-27 new operator, classes, instantiating, 37 infinite loops, 25 while statement, 25-26 nondisclosure agreement (NDA) for exams, 203-204 NOT operator (logical), 18 M NULL data type, 11 Mail Transport Agent (MTA), 128 numeric data values Mail User Agent (MUA) integer, 9-10 examples, 129 real, 9-10 security holes, 130 mail( ) function O command-line parameters, 139 email, sending, 132 object-oriented programming. See OOP matching string portions in substrings, objects 92-93 serializing, 44-45 MAX( ) function, 152 variables, assigning by reference, 38-42 merging arrays, 82-84 OOP (object-oriented programming), 35 messages classes delivery problems, troubleshooting, 139-140 declaring, 36-37 emails, formatting, 133-135 function of, 36 files, attaching, 135-139 inheritance, 42-44 MIME (Multipurpose Internet Mail instantiating, 37 Extensions), 134 as namespaces, 37-38 MIN( ) function, 152 encapsulation, 35 mktime( ) function, retrieval of UNIX objects time stamp from date array, 123 assigning variables by reference, 38-42 modes of files, changing (chmod( ) serializing, 44-45 function), 111 open questions (exam), 207 modifying substrings by offset, 97 open_basedir directive, shared hosting moving files, rename( ) function, 111 security, 180-181 multidimensional arrays, 66-68 open-source bytecode caches, 197 sorting, 78-81 opening multiple choice questions (exam), files with fopen( ) function, 106-107 205-206 sockets, 167-168 How can we make this index more useful? Email us at indexes@samspublishing.com
  10. 234 opening tags opening tags, 7-8 OR operator (logical), 18 operators, 14 ORDER BY clause, sorting databases, arithmetic, 15 152-153 array ([ ]), 63 outer joins, 150-151 assignment, 14 outputting files, fpassthru( ) function, associativity, 19-20 108 bitwise ownership of files, changing (chown( ) AND (&), 16 function), 111 AND (|), 16 left-shift (), 16 parameters (functions) XOR (^), 16 default values, 29 combined assignment, 19 passing by reference, 29 comparison, 17-18 receiving, 29 difference (!=), 17 variable number of, 31-32 equality (==), 17 patterns in regular expressions, greater than (>), 17 replacement of, 10 greater than or equal (=>), 17 PCRE (Perl Compatible Regular less than (
  11. rsort( ) function 235 POSIX regular expressions, 98 regular expressions (regexps), 98 precedence rules (operators), 19-20 data extraction, 100-101 prefix decrementing (—) operator, 15 pattern replacement, 101 prefix incrementing (++) operator, 15 PCRE (Perl Compatible Regular Expressions), 98 preg_replace( ) function, 101 base character classes, 98-99 preg_split( ) function, string splits, 101-102 enumerator operators, 99-100 primary keys (database indices), 148 pattern modifiers, 100 POSIX, 98 printf( ) function family functions relational databases (schemas), 146 fprint( ), 95 remote hosts, connecting via sockets, 166-167 sprint( ), 95 rename( ) function, files, moving, 111 vprint( ), 95 replacing vsprint( ), 95 patterns via regular expressions, 101 format specifiers, 93-95 substrings, 97-98 strings, formatting, 93-95 require construct, 8-9 processing forms via superglobal arrays, 51-54 require once construct, 8-9 reset( ) function, internal pointer, calling in arrays, 70-71 Q-R resource allocation, testing prior to code queries, limiting for database writing, 190-191 optimization measures, 195 resource data values, 12 questions (exam) resultsets fill-in-the-blank type, 207 aggregate functions, 152 multiple choice type, 205-206 grouping, 151-152 open type, 207 retrieving single choice type, 204-205 database information with SELECT statement, 150 randomizing arrays, 81-82 date arrays, 117-119 file information via fstats( ) function, 109 read pipelines, 165 stream metadata, 164-165 readfile( ) function UNIX time stamp, 117 files, reading, 112 from date arrays, 123 use with file wrappers, 163 from strings, 123-124 reading files RFCs (Request for Comments) email standards, 140 fread( ) function, 107 Internet Engineering Task Force (IETF), readfile( ) function, 112 172 single line at time (fgets( ) function), ROLLBACK TRANSACTION 107-108 command, 153 from sockets, 169 rows real numeric data types, 9-10 aggregates, 152 referential integrity, 148 tables register_globals directive, enabled deleting (DBMSs), 149-150 dangers, 178-179 inserting (DBMSs), 149 registering for Zend PHP Certification rsort( ) function, array sorts, 76-77 exam, 201-202 How can we make this index more useful? Email us at indexes@samspublishing.com
  12. 236 safe_mode directive S sendmail command, sending email on UNIX computers, 130-131 safe_mode directive, shared hosting serialize( ) function, 85-86 security, 180-181 serializing SASL (Simple Authentication and arrays, 85-86 Security Layer), 129 objects, 44-45 schemas (tables), 146 server-side processing versus client-side scope (variables), 30-31 processing, 50-51 scripts sessions, persistent data (HTTP), 56-57 conditional structures Set-Cookie header (HTTP), 54-55 case statement, 23-25 domain attribute, 55 if-then-else statement, 21-22 expires attribute, 55 overview, 21-22 path attribute, 55 elements of, 6 secure attribute, 55 email set_error_handler( ) function, 192-193 sending on Netware computers, 131-132 shared hosting, security measures sending on UNIX computers, 130-131 open_basedir directive, 180-181 sending on Windows computers, 131-132 safe_mode directive, 180-181 loop structures, 25 shell commands, security vulnerabilities continue statement, 28 with injections, 180 do-while statement, 26 Simple Authentication and Security for loop, 26-27 Layer (SASL), 129 while statement, 25-26 Simple Mail Transport Protocol. See sample, 7 SMTP tags, 7-8 single choice questions (exam), 204-205 variables, use of, 13 single quotes, declaration of string versus files, 8 values, 10 security sleep( ) function, object serialization, code error messages, displaying in 44-45 browsers, 192-193 SMTP (Simple Mail Transport cross-site scripting (XSS), prevention Protocol), 128 measures, 180 Mail Transport Agents (MTAs), data filtering transmission of, 128 blacklist approach, 178 Mail User Agents (MUAs) whitelist approach, 178 security holes, 130 databases, SQL injections, 179 transmission of, 129 register_globals directive, enabled dangers, sockets 178-179 blocking mode, 169-170 shared hosting book resources, 172 open_basedir directive, 180-181 closing, 171 safe_mode directive, 180-181 opening, 167-168 shell command injections, 180 persistent, 168 SELECT statement, database read/write timeouts, 170-171 information retrieval, 150 reading from, 169 sending email remote hosts, connecting to, 166-167 mail( ) function, 132 transports, 165 on Netware computers, 131-132 ssl, 167 on UNIX computers, 130-131 tcp, 167 on Windows computers, 131-132 tls, 167
  13. substr( ) function 237 udg, 167 file_get_contents( ) function, 163 udp, 167 filesystem functions, 162 unix, 167 function of, 158 writing to, 169 readfile( ) function, 163 sort( ) function, array sorts, 76-77 selecting, 158-159 sorting supported operations, 160-161 arrays, 76-78 metadata by keys, 74-76 function of, 163-164 database information by ORDER BY retrieving, 164-165 clause, 152-153 pipelines, 165 multidimensional arrays, 78-81 stream_context_create( ) function, 165 spam, 129 stream_get_meta_data( ) function, split( ) function, string splits, 101-102 164-165 splitting stream_set_blocking( ) function, 169-170 commands, code writing readability, 188 stream_set_timeout( ) function, 170-171 strings into components, 101-102 stream_wrapper_register( ) function, 160 SQL injections, security vulnerabilities, strftime( ) function, formatting tokens, 179 121-123 sscanf( ) function, 96-97 string values, declaration methods ssl transport (sockets), 167 double quotes, 10 statements heredoc syntax, 11 function of, 13 single quotes, 10 syntax requirements, 13 string-formatted dates, 115-116, 119-123 static data, performance optimization strings measures, 194 comparing STDIO transport (streams), 165 via comparison operators, 90 str_replace( ) function, 97-98 via strcasecmp( ) function, 91 strcasecmp( ) function, strings, via strcmp( ) function, 91 comparing, 91 data, extracting, 95-96 strcmp( ) function files, reading into (file_get_contents( ) dictionary ordering, 91 function), 113 strings, comparing, 91 formatted data, extracting, 96-97 streams formatting, 93-95 components of, 163 operators, concatnetion (.), 17 metadata portions, matching, 92-93 function of, 163-164 splitting into components, 101-102 retrieving, 164-165 strip_tags( ) function, cross-site scripting Streams architecture prevention, 180 built-in transports strncasecmp( ) function, 92 socket, 165 strncmp( ) function, 92 STDIO, 165 strstr( ) function, 92-93 components of, 163 strtotime( ) function, retrieval of UNIX context, creating, 165 time stamp from strings, 123-124 file wrappers subjects of email, setting, 133 built-in, 158-160 subpatterns in regular expressions, closing, 162 100-101 copy( ) function, 163 substituting variables in strings, 13 file( ) function, 163 substr( ) function, data extraction, 96 How can we make this index more useful? Email us at indexes@samspublishing.com
  14. 238 substr_replace( ) function substr_replace( ) function, 97 string-formatted dates, 115-116, 119-123 substrings, 92 UNIX time stamps, 115-116 leading, matching, 92 retrieving, 117 matching at arbitrary offsets, 92-93 retrieving from date arrays, 123 modifying by offset, 97 retrieving strings, 123-124 replacing, 97-98 time( ) function, UNIX time stamp subtraction (-) operator, 15 retrieval, 117 superglobal arrays timeouts (sockets) $_GET, 51-54 opening, 168 $_POST, 51-54 read/write operations, 170-171 form data, handling, 51-54 tls transport (sockets), 167 transactions (DBMSs) T COMMIT TRANSACTION command, 153 tables creating, 153 columns, 146 ROLLBACK TRANSACTION creating (DBMSs), 149 command, 153 data, retrieving (SELECT statement), 150 transports (streams) database optimization, 195-196 socket, 165 inner joins, 150-151 STDIO, 165 outer joins, 150-151 troubleshooting email delivery referential integrity, 148 problems, 139-140 rows, 146 typecasting operators aggregates, 152 (array), 19 deleting (DBMSs), 149-150 (float), 19 inserting (DBMSs), 149 (int), 19 tags (object), 19 closing, 7-8 (string), 19 code writing readability, 189 expression output, 8 opening, 7-8 U -V tcp transport (sockets), 167 udg transport (sockets), 167 ternary operators, if statements, udp transport (sockets), 167 embedding, 191-192 UNIX test centers email, sending, 130-131 arrival times, 202 time stamps, retrieving, 115-117 ID requirements, 202 from date arrays, 123 locating, 201 from strings, 123-124 materials provided, 203 unix transport (sockets), 167 personal belongings, 202 unlink( ) function, file deletion, 111 walk-in registrations, 202 unserialize( ) function, 85-86 text, line endings, correct detection of, 162 variable functions, 32-33 time formats Coordinated Universal Time (CUT), 116 variables date arrays, 115-116 array values, assigning, 65-66 assigning by reference, 38-42 retrieving, 117-119 data containment, 12 Greenwich Mean Time (GMT), 116
  15. Zend PHP Certification 239 dollar sign ($) syntax, 13 to files with fwrite( ) function, 108-109 function of, 12 indices for databases, 147 scope, 30-31 to sockets, 169 script advantages, 13 strings, substituting, 13 XOR operator (logical), 18 W-Z Zend Performance Suite, 197 Zend PHP Certification, exams, wake_up( ) function, object serialization, registering, 201 44-45 walking through arrays, 68-71 Web browsers error messages, displaying, 192-193 forms, processing, 51-54 HTTP requests, 50 web pages, output scripts, compression of, 195 web servers, performance optimization measures child processes, 194 DNS resolution reversal, 194 websites database optimization query limits, 195 table indexes, 195-196 Internet Engineering Task Force (IETF), 172 Internet Mail Consortium, 140 Pearson VUE, 201 while statement in loop structures, 25-26 whitelist approach, data filtering, 178 whitespace in code writing, 186 Windows, email, sending, 131-132 write pipelines, 165 writing code command splitting over multiple lines, 188 flattening of if statements, 187-188 if statements, embedding, 191-192 logical groupings, 186 predefined standards, 186 program documentation, 186 tag styles, 189 testing for resource allocation, 190-191 use of concatenation operator, 188-189 use of condition statements, 189-190 use of identity operators, 190 whitespace, 186 How can we make this index more useful? Email us at indexes@samspublishing.com
  16. Wouldn’t it be great if the world’s leading technical publishers joined forces to deliver their best tech books in a common digital reference platform? They have. Introducing InformIT Online Books powered by Safari. informit.com/onlinebooks ■ Specific answers to specific questions. InformIT Online Books’ powerful search engine gives you relevance-ranked results in a matter of seconds. ■ Immediate results. With InformIt Online Books, you can select the book you want and view the chapter or section you need immediately. ■ Cut, paste, and annotate. Paste code to save time and eliminate typographical errors. Make notes on the material you find useful and choose whether or not to share them with your workgroup. ■ Customized for your enterprise. Customize a library for you, your department, or your entire organization. You pay only for what you need. Get your first 14 days FREE! InformIT Online Books is offering its members a 10-book subscription risk free for 14 days. Visit http://www.informit.com/onlinebooks for details.
Đồng bộ tài khoản