parse_ini_string
Function • Params and return types changed in PHP 8.0
Parse a configuration string.
parse_ini_string Function synopsis
parse_ini_string(
string $ini_string,
bool $process_sections = false,
int $scanner_mode = INI_SCANNER_NORMAL
): array|false
Parameters
$ini_string
Typestring
The contents of the ini file being parsed.
$process_sections
OptionalTypeboolDefault valuefalse
By setting the $process_sections
parameter to true, you get a multidimensional array, with
the section names and settings included. The default
for $process_sections is false
$scanner_mode
OptionalTypeintDefault valueINI_SCANNER_NORMAL
Can either be INI_SCANNER_NORMAL (default) or
INI_SCANNER_RAW. If INI_SCANNER_RAW
is supplied, then option values will not be parsed.
Return value
Typearray|false
The settings are returned as an associative array on success,
and false on failure.
Changes to the parse_ini_string Function
PHP 8.0
- Return type added:
array|false - Parameter type added for parameter #1 (
$ini_string):string - Parameter type added for parameter #2 (
$process_sections):bool - Parameter default value added for position #2 (
$process_sections):false - Parameter type added for parameter #3 (
$scanner_mode):int - Parameter default value added for position #3 (
$scanner_mode):INI_SCANNER_NORMAL
parse_ini_string(
- $ini_string,
+ string $ini_string,
- $process_sections,
+ bool $process_sections = false,
- $scanner_mode
+ int $scanner_mode = INI_SCANNER_NORMAL
- )
+ ): array|false parse_ini_string Function Availability
parse_ini_string Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |