Convert INI to PHP Array

Input data

This form allows you convert INI files to PHP Array, paste or upload your INI below:


Your result can be seen below.

Result of INI conversion to PHP Array

Move to "Paste Code" for Save it

About INI conversion to PHP Array

About this tool

The Convert INI to PHP array was created for online converting INI files into appropriate PHP type as Array. This can come in handy for testing or debugging your INI data, also for fast formatting and adding PHP array to your config or anywhere else.

How it Works?

Just paste your INI config to the textarea above and click to the button "Convert" and you will get PHP array in the next textarea.

Example of conversion INI files to PHP Array

Before:
; This is a sample configuration file

[first_section]
one = 1
test = sample
animal = BIRD

[second_section]
path = "/var/test"
URL = "https://wtools.io/"
second_section[one] = "1 associated"
second_section[two] = "2 associated"
second_section[] = "1 unassociated"
second_section[] = "2 unassociated"

[third_section]
vaersion[] = "7.0"
vaersion[] = "7.1"
vaersion[] = "7.2"
vaersion[] = "7.3"
After:
[
  'first_section' => [
    'one' => '1',
    'test' => 'sample',
    'animal' => 'BIRD',
  ],
  'second_section' => [
    'path' => '/var/test',
    'URL' => 'https://wtools.io/',
    'second_section' => [
      'one' => '1 associated',
      'two' => '2 associated',
      0 => '1 unassociated',
      1 => '2 unassociated',
    ],
  ],
  'third_section' => [
    'vaersion' => [
      0 => '7.0',
      1 => '7.1',
      2 => '7.2',
      3 => '7.3',
    ],
  ],
]
After the conversion, you can apply the PHP array to your project or use it for some other purpose.
Donate

Did you like this tool? You can donate to us. This will help us improve our free web tools.

Paypal