Parsing INI With PHP Options

<?php

var_dump(parse_ini_string('A = true'));
var_dump(parse_ini_string('A = true',  scanner_mode: INI_SCANNER_TYPED));
var_dump(parse_ini_string('A = true',  scanner_mode: INI_SCANNER_RAW));

There are multiple configuration options for the native PHP INI parser: the default one reads the case-insensitive string ‘true’ as an integer; the typed parsing, with INI_SCANNER_TYPED produces a boolean, PHP-style; the raw analysis, with INI_SCANNER_RAW does not change anything, and provides a string.

See Also

PHP Features

Last updated: 28 August 2026