Convert HTML table to PHP Array

Input form

This form allows you convert HTML tables to PHP array, paste or upload your HTML file below:


Options

Your result can be seen below.

Result


Move to "Paste Code" for Save it

About conversion HTML table to PHP Array

About this tool

The Convert HTML table to PHP array was created for online transform code of HTML tables into PHP Array. For example, you found somewhere a large table whose data you need to import into your PHP code. No need to download or install any software.

How it Works?

Just paste or upload your HTML data to the textarea above and click to the button "Convert" and you will instantly get PHP Array.

Example of HTML conversion to PHP array

Before:
<!DOCTYPE html>
<html>
<head>
<style>h1{color:orange;text-align:center;}</style>
</head>
<body>
<h1>HTML example!</h1>
<p>This is a paragraph.</p>
<table>
<thead>
<tr>
<td>id</td>
<td>firstName</td>
<td>lastName</td>
<td>age</td>
</tr>
</thead>
<tr>
<td>1</td>
<td>Kim</td>
<td>Kardashian</td>
<td>39</td>
</tr>
<tr>
<td>2</td>
<td>Ariana</td>
<td>Grande</td>
<td>26</td>
</tr>
<tr>
<td>3</td>
<td>Cristiano</td>
<td>Ronaldo</td>
<td>35</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</body>
</html>
After:
[
  0 => [
    'id' => '1',
    'firstName' => 'Kim',
    'lastName' => 'Kardashian',
    'age' => '39',
  ],
  1 => [
    'id' => '2',
    'firstName' => 'Ariana',
    'lastName' => 'Grande',
    'age' => '26',
  ],
  2 => [
    'id' => '3',
    'firstName' => 'Cristiano',
    'lastName' => 'Ronaldo',
    'age' => '35',
  ],
]
After the conversion, you can apply the PHP array to your project or use it for some other purpose.