PHP Miscellaneous Functions
PHP Miscellaneous Functions Introduction
We group functions that do not belong to other categories into the miscellaneous functions category.
Installation
Miscellaneous functions are part of the PHP core. These functions can be used without installation.
Runtime Configuration
The behavior of Miscellaneous functions is affected by the settings in the php.ini file.
Miscellaneous configuration options:
| Name | Default | Description | Changeable |
|---|---|---|---|
| ignore_user_abort | "0" | FALSE indicates that the script will be terminated as soon as it attempts to output after the client has closed the connection. | PHP_INI_ALL |
| highlight.string | "#DD0000" | The color used to highlight strings matching PHP syntax. | PHP_INI_ALL |
| highlight.comment | "#FF8000" | The color used to highlight PHP comments. | PHP_INI_ALL |
| highlight.keyword | "#007700" | The color used to highlight PHP keywords in syntax highlighting (such as parentheses and semicolons). | PHP_INI_ALL |
| highlight.bg | "#FFFFFF" | Background color. | PHP_INI_ALL |
| highlight.default | "#0000BB" | The default color of PHP syntax. | PHP_INI_ALL |
| highlight.html | "#000000" | The color of HTML code. | PHP_INI_ALL |
| browscap | NULL | The name and location of the browser capabilities file (e.g.: browscap.ini). | PHP_INI_SYSTEM |
PHP Miscellaneous Functions
PHP: indicates the earliest PHP version that supports this function.
| function | Description | PHP |
|---|---|---|
| connection_aborted() | Checks whether the client has disconnected. | 3 |
| connection_status() | Returns the current connection status. | 3 |
| connection_timeout() | Deprecated since PHP 4.0.5. Checks whether the script has timed out. | 3 |
| constant() | Returns the value of a constant. | 4 |
| define() | Defines a constant. | 3 |
| defined() | Checks whether a constant exists. | 3 |
| die() | Outputs a message and exits the current script. | 3 |
| eval() | Evaluates a string as PHP code. | 3 |
| exit() | Outputs a message and exits the current script. | 3 |
| get_browser() | Returns the capabilities of the user's browser. | 3 |
| highlight_file() | Highlights PHP syntax in a file. | 4 |
| highlight_string() | Highlights PHP syntax in a string. | 4 |
| ignore_user_abort() | Sets whether disconnecting from the remote client will terminate script execution. | 3 |
| pack() | Packs data into a binary string. | 3 |
| php_check_syntax() | Deprecated since PHP 5.0.5. | 5 |
| php_strip_whitespace() | Returns the source code file with PHP comments and whitespace removed. | 5 |
| show_source() | Alias of highlight_file(). | 4 |
| sleep() | Delays code execution for a number of seconds. | 3 |
| time_nanosleep() | Delays code execution for a number of seconds and nanoseconds. | 5 |
| time_sleep_until() | Delays code execution until a specified time. | 5 |
| uniqid() | Generates a unique ID. | 3 |
| unpack() | Unpacks data from a binary string. | 3 |
| usleep() | Delays code execution for a number of microseconds. | 3 |
PHP Miscellaneous Constants
PHP: indicates the earliest PHP version that supports this constant.
| Constant | Description | PHP |
|---|---|---|
| CONNECTION_ABORTED | ||
| CONNECTION_NORMAL | ||
| CONNECTION_TIMEOUT | ||
| COMPILER_HALT_OFFSET | 5 |