Download the PHP package sweetchuck/ini-serializer without Composer
On this page you can find all versions of the php package sweetchuck/ini-serializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sweetchuck/ini-serializer
More information about sweetchuck/ini-serializer
Files in sweetchuck/ini-serializer
Download sweetchuck/ini-serializer
More information about sweetchuck/ini-serializer
Files in sweetchuck/ini-serializer
Vendor sweetchuck
Package ini-serializer
Short Description INI reader-writer
License GPL-2.0-or-later
Package ini-serializer
Short Description INI reader-writer
License GPL-2.0-or-later
Keywords iniserializer
Please rate this library. Is it a good library?
Informations about the package ini-serializer
INI encode/decode
A flexible PHP library for parsing and generating INI files with flexible type handling, customizable formatting options, and full control over serialization behavior.
Features
- Intelligent Type Conversion: Automatically converts values to proper PHP types (integers, floats, booleans, null)
- Customizable Type Aliases: Define your own values for
null,true, andfalse - Comment Support: Handles both
;and#style comments (configurable) - Grouped Sections: Full support for INI sections
[group_name] - Flexible Formatting: Control quote usage and spacing around equal signs
- Bidirectional: Parse INI strings to PHP arrays and emit PHP arrays back to INI format
- UTF-8 Ready: Built-in mbstring support for proper Unicode handling
Why Use This Over PHP's Native parse_ini_file()?
1. Predictable Type Conversion
- This library explicitly converts typed values (bool, null, int, float)
- You can configure which string values represent
true,false, andnull
2. Complete Bidirectional Support
- Native
parse_ini_file()only reads INI files - This library can generate INI files from PHP arrays, maintaining structure
3. Formatting Control
- Configure spacing around equal signs
- Control whether strings are quoted
- Generate consistently formatted INI files
4. Customizable Comment Characters
- Change which characters are treated as comments
- Useful for different INI dialects
5. Better Boolean Handling
- Recognizes multiple boolean representations:
- True:
true,on,yes - False:
false,off,no
- True:
- All case-insensitive
6. Proper Null Handling
- Distinguishes between empty strings and null values
- Recognizes
nullandnilas null values
7. Group Name Escaping
- Properly handles special characters in section names
[group_name]
Limitations
⚠️ Important: This library does not resolve PHP constants or environment variables.
- PHP constants like
\PHP_VERSIONor\E_ALLare treated as regular strings - Environment variables are not interpolated during parsing
- If you need constant/environment variable support, you should handle that separately before parsing or after parsing
Example:
Usage
Basic Parsing
Generating INI Files
Formatting Options
Customizing Type Values
Working with Existing Files
All versions of ini-serializer with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.4
ext-mbstring Version *
ext-mbstring Version *
The package sweetchuck/ini-serializer contains the following files
Loading the files please wait ...