Advertisement

MD Table to PHP Array converter

Convert MD Table to PHP Array free, right in your browser. Paste your MD Table input below and press Convert. You get a PHP file with return [...]; that you can include directly. No sign-up, and nothing is ever uploaded.

MD Table input

Paste your MD Table below, then press Convert.

Runs 100% in your browser. Nothing is uploaded.

Waiting for input.

Advertisement

How the conversion works

Paste your MD Table on the left and press Convert. The tool first parses the MD Table (reading the header row, the --- separator and each data row, honoring \| escapes) into an internal table of rows and columns, then writes it out as PHP Array (emitting short [...] syntax wrapped in a return statement). If the input cannot be parsed you get a plain-English error instead of a broken file.

Where this comes in handy

People reach for this converter when reusing tables from READMEs, wikis or notes and the data must be consumed by PHP code. Because everything runs locally in your browser, it is also handy for quick one-off migrations without installing database tools or writing throwaway scripts.

MD Table to PHP Array FAQs

How do I put a pipe character inside a cell?
Escape it with a backslash (\|) and it is treated as cell text instead of a column divider.
Will it work with tables from GitHub READMEs?
Yes. Standard GitHub flavored Markdown tables parse correctly, with or without leading and trailing pipes.
How do I use the output in my project?
Save it as a .php file and load it with $data = include 'file.php'; in your code.
What PHP syntax is used?
Modern short array syntax [...] with 'key' => value pairs, wrapped in <?php return [...]; so you can include the file directly.
Is there a size limit?
No hard limit, but very large pastes (tens of megabytes) can slow down the browser tab. For huge inputs, split them into smaller chunks.
Advertisement