Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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: 11 October 2026