PHP Miscellaneous Functions

PHP Miscellaneous Functions Introduction

We categorize functions that do not belong to other categories on this page.

Installation

Miscellaneous functions are part of the core of PHP. These functions can be used without installation.

Runtime Configuration

The behavior of miscellaneous functions is affected by the settings in php.ini.

Miscellaneous function configuration options:

Name Default Description Changeable
ignore_user_abort "0" FALSE indicates that the script will be terminated if it tries to output after the client terminates the connection. PHP_INI_ALL
highlight.string "#DD0000" Color used for highlighting strings that conform to PHP syntax. PHP_INI_ALL
highlight.comment "#FF8000" Color used for highlighting PHP comments. PHP_INI_ALL
highlight.keyword "#007700" Color used for highlighting PHP keywords (such as parentheses and semicolons). PHP_INI_ALL
highlight.bg "#FFFFFF" Background color. PHP_INI_ALL
highlight.default "#0000BB" Default color of PHP syntax. PHP_INI_ALL
highlight.html "#000000" HTML code color. PHP_INI_ALL
browscap NULL The name and location of the browser performance file (e.g., browscap.ini). PHP_INI_SYSTEM

PHP Miscellaneous Functions

PHP:Indicate the earliest PHP version that supports this function.

Function Description PHP
connection_aborted() Check if the client has disconnected. 3
connection_status() Return the current connection status. 3
connection_timeout() Not recommended for use in PHP 4.0.5. 3
constant() Return the value of a constant. 4
define() Define a constant. 3
defined() Check if a constant exists. 3
die() Outputs a message and exits the current script. 3
eval() Calculates the string as PHP code. 3
exit() Outputs a message and exits the current script. 3
get_browser() Returns the performance of the user's browser. 3
highlight_file() Syntax highlighting for files. 4
highlight_string() Syntax highlighting for strings. 4
ignore_user_abort() Sets whether the script execution will be terminated when the client disconnects. 3
pack() Packs data into a binary string. 3
php_check_syntax() Not recommended for use in PHP 5.0.5. 5
php_strip_whitespace() Returns the source code file with removed PHP comments and whitespace characters. 5
show_source() Alias of highlight_file(). 4
sleep() Delays the execution of the code for several seconds. 3
time_nanosleep() Delays the execution of the code for several seconds and nanoseconds. 5
time_sleep_until() Delays the execution of the code for the specified time. 5
uniqid() Generates a unique ID. 3
unpack() Unpacks data from a binary string. 3
usleep() Delays the execution of the code for several microseconds. 3

PHP Date / Time Constants

PHP:Indicates the earliest PHP version that supports the constant.

Constants Description PHP
CONNECTION_ABORTED    
CONNECTION_NORMAL    
CONNECTION_TIMEOUT    
__COMPILER_HALT_OFFSET__   5