PHP Developer''''s Dictionary- P50 pdf

5 189 0
PHP Developer''''s Dictionary- P50 pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

PHP Developer’s Dictionary IT-SC book 245 apache_note() Syntax apache_note( note_name, [note_value] ); Description The apache_note() function sendsand receives informationto the request's notes table. When the function ispassed one argument, it returns the value of note_name. If apache_note() is called with two arguments, it sets the value of note_name to note_value andreturns the previous value of note_name. getallheaders() Syntax getallheaders(); Description The getallheaders() function returns an associative array of all the HTTP headers in the current HTTP request. All the header variables are available to you as individual PHP variables, but this function presents those variables to you in a single array. virtual() Syntax virtual(filename); Description The virtual() function is used to include a file defined by filename into the PHP request. This is equivalent to the Server Side Include (SSI) syntax <! #include virtual filename > . This function cannot be used to include a PHP file, and if it encounters an error, false (0) is returned. Mail Sending an email from a PHP script can be a very powerful tool. It is often used to alert users or administrators to specific conditions specified within the application. PHP Developer’s Dictionary IT-SC book 246 The single mail() function described in the following section is the interface to SMTP- and sendmail-compatible applications on a UNIX system and SMTP-compatible mail servers on Windows. mail() Syntax mail(recipient, subject, message, [additional_headers]); Description The mail() function is used to send an email with the body of the email specified bythe message parameter to the email address defined in recipient. The subject for the email isdefined by the subject parameter. Multiple recipients can bespecified by a comma-delimited list in recipient. Theoptional parameter additional_headers is used to defineadditional header information that can be inserted at the end of the originalemail header. Multiple additional_headers are delimited withthe carriage return linefeed characters, "\ r\ n". Additionalheader information can be used to specify the senders address or the format ofthe email. Calling the mail() function in a UNIX environment invokes the sendmail shell command. The Windows environment will establish a connection with the SMTP server to send the mail. Specific mail parameters are set in the [mail function] section of the php.ini configuration file. If the mail() function encounters an error, false (0) is returned. Network This section describes a set of functions that use standard Internet protocols to communicate and return information about network resources. Debugging functions are also described in this section because of their method of implementation. checkdnsrr() Syntax checkdnsrr(host, [type]); Description The checkdnsrr() function searches DNS records for a hostname defined by host having a specific type. It returns true, 1, if any records are found and returns false, 0, if no records were found or if an error occurred. Table 7.2 shows the valid DNS record types. Table 7.2. Valid DNS Record Types PHP Developer’s Dictionary IT-SC book 247 Type Description A IP Address MX Mail Exchanger (Default) NS Name Server SOA Start of Authority PTR Pointer to other information CNAME Canonical Name ANY Any records A valid value for host is the IP address in dotted-quad notation or the hostname. closelog() Syntax closelog(); Description The closelog() function closes the file descriptor that is used to write to the system logger. The use of this function is optional, but recommended. debugger_off() Syntax debugger_off(); Description The debugger_off() function tells PHP to stop sending information to the internal debugger. debugger_on() Syntax debugger_on(address); Description PHP Developer’s Dictionary IT-SC book 248 The debugger_on() function tells PHP to start sending diagnostic information to the internal debugger. The address attribute is the IP address of the host used for debugging. The port is set in the [Debugger] section of the php.ini file. fsockopen() Syntax fsockopen(hostname, port, [errno], [errstr], [timeout]); Description The fsockopen() function establishes a TCP socket connection to port running on hostname. The optional timeout parameter defines the timeout for the connect() system call. If fsockopen() is not successful, it will return false, 0. The optional variables used for errno and errstr will be set to indicate the system-level error number and string of system errors that occurred. If fsockopen() is successful, it will return a file pointer that can then be used by other file-related functions, such as fputs() , fgets(), fclose(), and so on. gethostbyaddr() Syntax gethostbyaddr(ip_address); Description The gethostbyaddr() function returns the hostname specified by ip_address. If the function is not successful, it will return false, 0. gethostbyname() Syntax gethostbyname(hostname); Description The gethostbyname() function returns the IP address in dotted-quad notation of the Internet host specified by hostname . PHP Developer’s Dictionary IT-SC book 249 gethostbynamel() Syntax gethostbynamel(hostname); Description The gethostbynamel() function returns an array containing a list of the IP addresses to which the Internet host specified by hostname resolves. getmxrr() Syntax getmxrr(hostname, mxhosts, [weight]); Description The getmxrr() function searches DNS for all MX (Mail Exchanger) records for the host defined by hostname . This function will return true, 1, if any records are found, and false, 0, is returned if no records were found or an error occurred. The list of the records found is placed into the mxhosts array. Optionally, if the weight for the MX records is returned, the array weight will contain this information. getprotobyname() Syntax getprotobyname(name); Description The getprotobyname() function returns the number associated with the protocol name defined by name . This number is retrieved from /etc/protocols. getprotobynumber() Syntax getprotobynumber(number); . filename into the PHP request. This is equivalent to the Server Side Include (SSI) syntax <! #include virtual filename > . This function cannot be used to include a PHP file, and if. Sending an email from a PHP script can be a very powerful tool. It is often used to alert users or administrators to specific conditions specified within the application. PHP Developer’s Dictionary. The debugger_off() function tells PHP to stop sending information to the internal debugger. debugger_on() Syntax debugger_on(address); Description PHP Developer’s Dictionary IT-SC

Ngày đăng: 07/07/2014, 05:20

Mục lục

  • Cover

  • PHP Developer's Dictionary

  • About the Authors

  • Acknowledgments

    • Tell Us What You Think!

    • Introduction

      • Who Should Buy This Book?

      • Organization of the Chapters

      • Writing Conventions

      • Chapter 1. Basic PHP Background and History

        • Advantages of PHP 4

        • Installation

          • PHP Installation General Overview

          • Configuration Options

          • Types, Variables, and Constants

          • Arrays

          • Strings

          • Type Conversion

          • Variables

          • Constants

          • Operators and Mathematical Functions

            • Expressions and Operators

            • Control Structures

            • Mathematical Functions

            • Functions, Classes, and Objects

              • Functions

Tài liệu cùng người dùng

Tài liệu liên quan