


Detailed explanation based on the use of PHP options and information functions_PHP tutorial
bool assert ( mixed $assertion [, string $description ] ) — Checks whether an assertion is FALSE
assert_options(ASSERT_ACTIVE, true);//Allows the use of the assert() function
assert_options(ASSERT_WARNING, false);//Does not output a warning message when assert fails
assert_options(ASSERT_BAIL, true);//Terminate code execution after assert fails
assert_options(ASSERT_CALLBACK, 'getMsg');//Terminate code execution after assert fails.
echo 'Start:
';
assert('mysql_query("")');
echo 'Test successful! ';
function getMsg(){
echo 'An error occurred! ';
}
mixed assert_options ( int $what [, mixed $value ] ) — Set various control options for assert(), or query the current settings
ASSERT_ACTIVE: Whether to enable assert() assertion, ini configuration assert.active, default value 1
ASSERT_WARNING: Whether to generate a PHP warning for each failed assertion, ini configuration assert.warning, default value 1
ASSERT_BAIL : Whether to abort execution when assertion fails, ini configuration assert.bail, default value 0
ASSERT_QUIET_EVAL: Whether to disable error_reporting when assertion expression is evaluated, ini configuration assert.quiet_eval, default value 0
ASSERT_CALLBACK: Assertion failed The callback function is called when the ini configuration assert.callback
assert_options(ASSERT_ACTIVE, true);/ /Allow the use of the assert() function
assert_options(ASSERT_WARNING, false);//Do not output warning information when assert fails
assert_options(ASSERT_BAIL, true);//Terminate code execution after assert fails
assert_options( ASSERT_CALLBACK, 'getMsg'); // Terminate code execution after assert fails.
echo 'Start:
';
assert(is_int(1.2));//The detection result is false
echo 'Test successful! ';
function getMsg(){
echo 'An error occurred! ';
}
bool dl( string $library ) — Get the value of PHP configuration option and load the specified PHP extension
if(!extension_loaded('sqlite')){//Test whether the specified extension has been activated
$prefix = (PHP_SHLIB_SUFFIX === 'dll ') ? 'php_' : '';
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
}
int gc_collect_cycles() — Force collection of all existing garbage Cycle period
void gc_disable (void) — Disable the circular reference collector
void gc_enable (void) — Activate the circular reference collector
bool gc_enabled (void) — Return the status of the circular reference counter
string get_cfg_var ( string $option ) — Get the value of the PHP configuration option Get the value of the PHP configuration option
string get_current_user ( void ) — Get the current PHP script owner name
array get_defined_constants ([ bool $categorize = false ] ) — Returns an associative array of all constants
array get_extension_funcs ( string $module_name ) — Returns an array of module function names
print_r(get_extension_funcs("xml"));
string get_include_path (void) — Get the current include_path configuration option
array get_included_files (void) — Return the included and require Array of file names
include 'test1.php';
include_once 'test2. php';
require 'test3.php';
require_once 'test4.php';
$included_files = get_included_files();
foreach ($included_files as $filename) {
echo "$filenamen";
}
array get_loaded_extensions ([ bool $zend_extensions = false ] ) — Returns an array of all compiled and loaded module names
bool get_magic_quotes_gpc ( void ) — Get the current magic_quotes_gpc configuration option settings
bool get_magic_quotes_runtime ( void ) — Get the activation status of the current magic_quotes_runtime configuration option
string getenv ( string $varname ) — Get the value of an environment variable
$ip = getenv('REMOTE_ADDR');
int getlastmod (void)—Get the last modified time of the page
int getmygid (void)—Get the GID of the current PHP script owner
int getmyinode (void)—Get the index node (inode) of the current script
int getmypid (void) — Get the ID of the PHP process
int getmyuid ( void ) — Get the UID of the PHP script owner
array getopt ( string $options [, array $longopts ] ) — From the command line Get options in the parameter list
array getrusage ([ int $who = 0 ] ) — Get the current resource usage
array ini_get_all ([ string $extension [, bool $details = true ]] ) — Get all configuration options
print_r(ini_get_all("pcre"));
print_r(ini_get_all() );
string ini_get ( string $varname ) — Get the value of a configuration option
void ini_restore ( string $varname ) — Restore the default value of a configuration option
string ini_set ( string $ varname , string $newvalue ) — Sets the value for a configuration option
main — Virtual main() int memory_get_peak_usage ([ bool $real_usage = false ] ) — Returns the peak int memory_get_usage ([ bool $real_usage = false ] ) — Returns the amount of memory allocated to PHP
string php_ini_loaded_file ( void ) — Gets the path to the loaded php.ini file
string php_ini_scanned_files ( void ) — Returns the .ini file parsed from the extra ini directory List
string php_sapi_name (void) — Returns the interface type between the web server and PHP
string php_uname ([ string $mode = "a" ] ) — Returns information about the system running PHP
'a ': This is the default all.
's': operating system name
'n': host name. For example: localhost.example.com.
'r': Version name, for example: 5.1.2-RELEASE.
'v': version information. There are big differences between operating systems.
'm': machine type. For example: i386.
bool phpcredits ([ int $flag = CREDITS_ALL ] ) — Print PHP contributor list
CREDITS_ALL : All
CREDITS_DOCS : Document group contribution list
CREDITS_FULLPAGE : Often used in combination with other flags. Indicates the need to print a separate HTML page containing information represented by other flags.
CREDITS_GENERAL: General list: language design and philosophy, PHP authors and SAPI modules
CREDITS_GROUP: Core developer list
CREDITS_MODULES: PHP extension modules and authors
CREDITS_SAPI: PHP server API modules and authors
phpcredits(CREDITS_GROUP | CREDITS_DOCS | CREDITS_FULLPAGE);
bool phpinfo ([ int $what = INFO_ALL ] ) — Output information about PHP configuration
string phpversion ([ string $extension ] ) — Get the current PHP version
bool putenv ( string $setting ) — Set environment variables Value
void restore_include_path (void) — Restore the value of the include_path configuration option
string set_include_path ( string $new_include_path ) — Set the include_path configuration option
void set_time_limit ( int $seconds ) — Set the maximum execution time of the script from which Start timing by itself, 0 means no time limit
string sys_get_temp_dir ( void ) — Returns the directory used for temporary files
mixed version_compare ( string $version1 , string $version2 [, string $operator ] ) — Compare two PHP normalizations The version number string
if (version_compare(PHP_VERSION, '5.3.0') > ;= 0) {
echo 'My PHP version is very high: ' . PHP_VERSION . "n";
}
int zend_thread_id (void) — Returns the unique identification of the current thread Symbol
string zend_version (void) — Get the current Zend engine version

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.
