PHP Developer''''s Dictionary- P31 potx

5 254 0
PHP Developer''''s Dictionary- P31 potx

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

Thông tin tài liệu

PHP Developer’s Dictionary IT-SC book 150 Description The unserialize() function, which was added in PHP 3.0.5 and PHP 4.0b4, returns the original PHP value of str before it was serialized. The value can be an integer, double, string, array, or object. An object's methods cannot be serialized, only its properties. usleep() Syntax void usleep(int micro_seconds) Description The usleep() function causes script processing to pause for the number of microseconds specified by micro_seconds . PHP Options and Information PHP provides the functions that enable you to examine information about the current version of PHP that is running, along with information from the operating system about the PHP process. Additionally, it allows scripts to interact with the operating system environment. assert() Syntax int assert (string|bool assertion) Description The assert() function, which was added in PHP 4.0b4, examines the given assertion and takes action if the result is false. If the parameter is a string, it will be executed. Assertions should be used only as a debugging feature, and not used for normal runtime operations. assert_options() Syntax int assert_options (int what [,mixed value) PHP Developer’s Dictionary IT-SC book 151 Description The assert_options() function , which was added in PHP 4.0b4, enables you both to examine and set the assertion options. The following options are available: Option ini Setting Default Description ASSERT_ACTIVE assert.active 1 assert() is on ASSERT_WARNING assert.warning 1 Issues a warning for each failure ASSERT_BAIL assert.bail 0 Terminates execution if assertion fails ASSERT_QUIET_EVAL assert.quiet_eval 0 Disables error reporting during assertion evaluation ASSERT_CALLBACK assert_callback (null) Calls a user function on failed assertions error_log() Syntax int error_log(string message, int message_type, string [destination] , string [extra_headers] ) Description The error_log() function can send a message to a Web server's error log, a TCP port, or to a file. The message parameter represents the information that should be logged. The message_type parameter indicates where the message should be directed and has four possible values: 0— message is sent to PHP's system logger, which is determined by the setting of the error_log configuration option. 1— message is sent via email to the address denoted by the destination parameter. The parameter extra_headers is used with this option as well. The option behaves similar to mail() . 2— message is sent through the PHP debugging connection. This is possible only when remote debugging is enabled. For this option, destination indicates the host and port of the connection listening for debugging information. 3— message is written to the end of the file specified by destination . error_reporting() PHP Developer’s Dictionary IT-SC book 152 Syntax int error_reporting(int [level] ) Description The error_reporting() function sets the PHP error-reporting level and returns the previous setting. The parameter level is an additive bitmask made up of the following codes: Value Internal Name 1 E_ERROR 2 E_WARNING 4 E_PARSE 8 E_NOTICE 16 E_CORE_ERROR 32 E_CORE_WARNING There also exists an E_ALL name, which is equal to 15 ( 1 + 2 + 4 + 8 ). Multiple levels are indicated by adding the values together. For example, to indicate warnings and error messages, specify level 3 . extension_loaded() Syntax bool extension_loaded(string name) Description The extension_loaded() function, which was added in PHP 3.0.10 and PHP 4.0b4, returns true if the PHP extension called name is loaded. getenv() Syntax string getenv(string varname) Description PHP Developer’s Dictionary IT-SC book 153 The getenv() function returns the value of the environment variable specified by varname , and false if the environment variable doesn't exist. get_cfg_var() Syntax string get_cgf_var(string varname) Description The get_cfg_var() function returns the current value of varname , which is the name of a PHP configuration variable. If this variable doesn't exist, false is returned. The function doesn't read compile time settings or variables set from the Apache configuration file. To verify that PHP is utilizing a configuration file, check the return value of the cfg_file_path configuration setting. If this value exists, a configuration file is being used. get_current_user() Syntax string get_current_user(void) Description The get_current_user() function returns the name of the owner of the current PHP script. get_magic_quotes_gpc() Syntax long get_magic_quotes_gpc(void) Description The get_magic_quotes_gpc() function, which was added in PHP 3.0.6 and PHP 4.0, returns the current active configuration setting of magic_quotes_gpc . ( 0 for off, 1 for on). GPC stands for Get/Post/Cookie, and is used to escape quotes in strings that are returned from function calls. When magic_quotes_gpc is active, all '(singlequotes), PHP Developer’s Dictionary IT-SC book 154 (double quotes), \\ (backslashes), and NULs are automatically escaped with a backslash. get_magic_quotes_runtime() Syntax long get_magic_quotes_runtime(void) Description The get_magic_quotes_runtime() function, which was added in PHP 3.0.6 and PHP 4.0, returns the current active configuration setting of magic_quotes_runtime . ( 0 for off, 1 for on). GPC stands for Get/Post/Cookie, and is used to escape quotes in strings that are returned from function calls. When magic_quotes_runtime is active, all '(single quotes), (double quotes), \\ (backslashes), and NULs are escaped with a backslash automatically. getlastmod() Syntax int getlastmod(void) Description The getlastmod() function returns the UNIX timestamp indicating the last change of the currently executing script. The timestamp is of a format that is suitable for feeding to the date() function. If an error occurs in retrieving the last modification date, false will be returned. getmyinode() Syntax int getmyinode(void) Description The getmyinode() function returns the current executing script's inode information, or false on error. . PHP Developer’s Dictionary IT-SC book 150 Description The unserialize() function, which was added in PHP 3.0.5 and PHP 4.0b4, returns the original PHP value of str before. which was added in PHP 3.0.10 and PHP 4.0b4, returns true if the PHP extension called name is loaded. getenv() Syntax string getenv(string varname) Description PHP Developer’s Dictionary. microseconds specified by micro_seconds . PHP Options and Information PHP provides the functions that enable you to examine information about the current version of PHP that is running, along with information

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

Mục lục

    PHP Developer's Dictionary

    Tell Us What You Think!

    Who Should Buy This Book?

    Organization of the Chapters

    Chapter 1. Basic PHP Background and History

    PHP Installation General Overview

    Types, Variables, and Constants

    Operators and Mathematical Functions

    Functions, Classes, and Objects

    Using Request Variables to Generate Content

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

  • Đang cập nhật ...

Tài liệu liên quan