Home > Article > Backend Development > A complete list of the most commonly used built-in functions in PHP
$_SERVER['SCRIPT_NAME'] returns /mantis/test.php, relative path;
__FILE__ returns the absolute path of the file D:\Projects\mantis\test.php
$_SERVER['HTTP_X_FORWARDED_PROTO']
$_SERVER['HTTPS']
set_time_limit() sets the maximum execution time of the script
isset
str_replace( "\0", '', $t_self ) Replaces \0 in t_self with ""
strpos — Find the first occurrence in the string
$ _SERVER['SERVER_SOFTWARE'] Server information
realpath Returns the normalized absolute path name
DIRECTORY_SEPARATOR Operating system directory separator
PATH_SEPARATOR is a ":" sign in Linux systems, and a ";" sign on Windows
set_include_path Set include_path
$_SERVER['LOCAL_ADDR'] Used on IIS7 to obtain the server IP address
$_SERVER['REMOTE_ADDR'] The IP address of the browser user
array_pad — pads an array to the specified length with values
memory_get_usage() returns the amount of memory allocated to PHP
spl_autoload_register registers the __autoload() function
ob_get_contents() Returns the contents of the output buffer
strtolower() Convert uppercase letters to lowercase letters
extension_loaded('zlib') Find out whether the extension is loaded
ini_get Returns the value of the configuration item in php.ini
ini_set Sets the configuration item in php.ini The value of ini_set("memory_limit",'256M'); only takes effect during script execution. The value is reset after the script is executed.
PHP_EOL PHP line terminator
ceil() Rounding method
floor() Rounding method
round() Rounding method
The above is the detailed content of A complete list of the most commonly used built-in functions in PHP. For more information, please follow other related articles on the PHP Chinese website!