Report

Help us improve this tool

YAML to PHP Array Converter

Turn YAML documents into PHP array syntax with short or long array style and variable wrapping.

O M T

Convert YAML to PHP arrays

Transform YAML configuration into PHP array syntax for Laravel, WordPress, or legacy apps. Choose short [] or long array() style and optionally assign to a named variable.

See also: PHP Array to YAML Converter, YAML to INI Converter, and JSON to PHP Array Converter.

Frequently Asked Questions

Which array style should I use?

Modern PHP projects typically use short arrays. Long array() syntax helps when pasting into codebases that still avoid short tags.

Are keys quoted?

Associative keys are emitted as single-quoted PHP strings. Numeric list indices are unquoted integers.

Can I upload a YAML file?

Yes. Use the file control to load .yaml or .yml files; conversion updates as you edit.