HTML Table to PHP Array Converter
Turn HTML table markup into PHP array code with short or long syntax and optional type coercion.
Generate PHP arrays from HTML tables
When you inherit legacy admin pages or exported reports, the fastest path to structured PHP data is often the table markup itself. This converter extracts rows, applies header keys, coerces scalar types, and prints short or long PHP array syntax ready to paste into your project.
Working from CSV instead? Use the CSV to PHP Array Converter. For JSON output from the same HTML, open the HTML Table to JSON Converter.
Frequently Asked Questions
What PHP array styles are supported?
Choose short bracket syntax or long array() syntax. You can wrap the result in a variable assignment such as $rows = [...]; or copy the bare array literal.
How does type coercion work?
When enabled, integer, decimal, and true/false strings become native PHP scalars in the generated code. Other values remain single-quoted strings with escaping applied.
Can multiple tables be converted at once?
Yes. Selecting all tables produces a nested PHP array with one child array per table in source order.