Advertisement

INI to PHP array converter

Convert INI to PHP array free in your browser. Paste your INI on the left, press Convert, and copy clean PHP array on the right. No sign-up, no uploads.

Converter

Paste INI below, press Convert, and copy the PHP array output.

Advertisement

How INI becomes PHP array

The parser scans the INI line by line, tracking the current [section] header and turning every key = value line into a row with section, key and value columns. Comments and blank lines are skipped, quoted values are unwrapped, and scalars are auto-typed, giving a tidy three-column table that maps directly onto PHP array.

Tips for the PHP output

The snippet assigns $data, so rename the variable or wrap it in a return statement if you are building a config file. It is also a quick way to seed Laravel or WordPress fixtures: convert, paste into a seeder, and the nested array() syntax works on every supported PHP version.

INI to PHP array FAQs

How are INI sections turned into rows?
Every key under a [section] becomes one row with three columns: section, key and value. Keys before the first section header get an empty section name. Comments starting with ; or # are ignored, and quoted values keep their inner text while numbers and true/false are typed automatically.
Is the PHP output valid code I can run?
Yes. It prints a complete <?php snippet assigning $data with classic array() syntax, single-quoted strings with escaping, and null/true/false literals. Paste it straight into any PHP 5.4+ project. Nested values from INI fields are rendered as nested arrays.
What happens to nested or repeated sections?
Repeated [section] headers are merged in order, so duplicate keys keep their last value, and each section/key pair becomes its own row. That flat section/key/value table maps cleanly onto PHP array without losing which section a value came from.
Is there a size limit for INI input?
No hard limit, but everything runs in your browser tab, so tens of thousands of rows convert in seconds while millions of rows may slow the page. For very large INI files, split them into smaller chunks and convert each separately.
Is my INI data private, and who uses this?
Yes. The conversion runs 100% in your browser; nothing is uploaded to any server. Developers, analysts and DBAs use it to move INI data into PHP array for migrations, reports and config work without installing anything.
Advertisement