PHP 5 Misc. Functions

The misc. functions were only placed here because none of the other categories seemed to fit.The misc. functions are part of the PHP core. No installation is required to use these functions.The behavior of the misc. functions is affected by settings in the php.ini file.

PHP Miscellaneous Functions

FunctionDescription
connection_aborted()Checks whether the client has disconnected
connection_status()Returns the current connection status
connection_timeout()Deprecated in PHP 4.0.5. Checks whether the script has timed out
constant()Returns the value of a constant
define()Defines a constant
defined()Checks whether a constant exists
die()Prints a message and exits the current script
eval()Evaluates a string as PHP code
exit()Prints a message and exits the current script
get_browser()Returns the capabilities of the user's browser
__halt_compiler()Halts the compiler execution
highlight_file()Outputs a file with the PHP syntax highlighted
highlight_string()Outputs a string with the PHP syntax highlighted
ignore_user_abort()Sets whether a remote client can abort the running of a script
pack()Packs data into a binary string
php_check_syntax()Deprecated in PHP 5.0.5
php_strip_whitespace()Returns the source code of a file with PHP comments and whitespace removed
show_source()Alias of highlight_file()
sleep()Delays code execution for a number of seconds
sys_getloadavg()Gets system load average
time_nanosleep()Delays code execution for a number of seconds and nanoseconds
time_sleep_until()Delays code execution until a specified time
uniqid()Generates a unique ID
unpack()Unpacks data from a binary string
usleep()Delays code execution for a number of microseconds

Misc. configuration options:

NameDescriptionDefaultChangeable
ignore_user_abortFALSE indicates that scripts will be terminated as soon as they try to output something after a client has aborted their connection"0"PHP_INI_ALL
highlight.stringColor for highlighting a string in PHP syntax"#DD0000"PHP_INI_ALL
highlight.commentColor for highlighting PHP comments"#FF8000"PHP_INI_ALL
highlight.keywordColor for syntax highlighting PHP keywords (e.g. parenthesis and semicolon)"#007700"PHP_INI_ALL
highlight.bgRemoved in PHP 5.4.0. Color for background"#FFFFFF"PHP_INI_ALL
highlight.defaultDefault color for PHP syntax"#0000BB"PHP_INI_ALL
highlight.htmlColor for HTML code"#000000"PHP_INI_ALL
browscapName and location of browser-capabilities file (e.g. browscap.ini)NULLPHP_INI_SYSTEM